<template>
    <div style=" position: relative;">
        <el-card class="card_css">
            <template #header>
                <!-- 头部信息 -->
                <div class="dgts-row">
                    <div class="dgts-text-tj1">
                        <b class="tr-it-title c-green">累计</b>
                        <!-- <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-green">收入：{{ 0 }} 元</span> -->
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">支出：{{ dg.totalPay }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">收入：{{ dg.totalGath }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">燃油费：{{ dg.oilFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">过路费：{{ dg.roadFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">停车费：{{ dg.parkingFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">洗车费：{{ dg.washingFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">用餐费：{{ dg.livingFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">买水费：{{ dg.waterFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">打单费：{{ dg.singleFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">住宿费：{{ dg.stayFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">其他费：{{ dg.otherFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">打的费：{{ dg.taxiFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">效率值：{{ dg.efficiency }} %</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">油耗：{{ dg.oilRise }} %</span>
                    </div>
                </div>

                <div class="dgts-row">
                    <div class="dgts-text-tj2">
                        <b class="tr-it-title c-green">所选</b>

                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">支出：{{ seledPay }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">收入：{{ totalGath }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">燃油费：{{ oilFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">过路费：{{ roadFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">停车费：{{ parkingFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">洗车费：{{ washingFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">用餐费：{{ livingFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">买水费：{{ waterFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">打单费：{{ singleFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">住宿费：{{ stayFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">其他费：{{ otherFee }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">打的费：{{ taxiFee }} 元</span>

                    </div>
                </div>
                <!-- 搜索 -->
                <div style="margin-top:10px;">
                    <el-select size="small" v-model="find_data.timeType" placeholder="时间类型" style="width: 90px;">
                        <el-option label="添加时间" value="1"></el-option>
                        <el-option label="发生时间" value="2"></el-option>
                    </el-select>

                    <el-date-picker :default-time="defaultTime" size="small" style="margin-left: 10px;width: 290px;"
                        v-model="timeTypeTime" @change="timeTypeTime_btn" type="datetimerange" start-placeholder="开始时间"
                        end-placeholder="结束时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />

                    <el-select size="small" style="margin-left: 10px;width: 160px;" v-model="find_data.reimStatus"
                        clearable multiple collapse-tags placeholder="报账状态">
                        <el-option label="未审核" value="NO_CHECK"></el-option>
                        <el-option label="已审核" value="CHECKED"></el-option>
                        <el-option label="已报销" value="CANCELLATION"></el-option>
                        <el-option label="已拒绝" value="REFUSED"></el-option>
                    </el-select>

                    <el-cascader size="small" style="margin-left: 10px;width: 150px;" v-model="curval2"
                        :options="findAllDeptList_list" :collapse-tags="true" :clearable="true"
                        :props="{ multiple: true, checkStrictly: true, emitPath: true, value: 'id', label: 'deptName' }"
                        placeholder="请选择部门" :show-all-levels="false" @change="handleChange_find">
                        <template #="{ node, data }">
                            <span>{{ data.deptName }}</span>
                            <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
                        </template>
                    </el-cascader>

                    <el-select size="small" style="margin-left: 10px;width: 100px;" v-model="find_data.operUserId"
                        clearable filterable placeholder="经办人">
                        <el-option v-for="item in serviceManList" :key="item.ftUserId" :label="item.realName"
                            :value="item.ftUserId">
                        </el-option>
                    </el-select>

                    <el-input size="small" style="margin-left: 10px;width: 100px;" v-model="find_data.reimUser"
                        placeholder="收款人" clearable />

                    <el-input type="number" size="small" style="margin-left: 10px;width: 100px;"
                        v-model="find_data.reimMoney" placeholder="报账金额" clearable />
                    <el-select size="small" style="margin-left: 10px;width: 160px;" v-model="find_data.tradeStatus"
                        clearable placeholder="收支类型">
                        <el-option label="收入" value="0"></el-option>
                        <el-option label="支出" value="1"></el-option>
                    </el-select>

                </div>

                <div>
                    <el-select size="small" v-model="find_data.plateNum" clearable filterable placeholder="车牌号"
                        style="width: 100px">
                        <el-option v-for="item in carNumList" :key="item.id" :label="item.plate_num"
                            :value="item.plate_num">
                        </el-option>
                    </el-select>
                    <el-select size="small" style="margin-left: 10px;width:140px" multiple
                        v-model="find_data.moneyTypeIds" clearable collapse-tags filterable placeholder="金额类型">
                        <el-option v-for="item in reimTypeOptions" :key="item.id" :label="item.text" :value="item.id">
                        </el-option>
                    </el-select>

                    <el-input size="small" style="margin-left: 10px;width: 150px;" v-model="find_data.operMark"
                        placeholder="操作标示" clearable />

                    <el-input size="small" style="margin-left: 10px;width: 150px;" v-model="find_data.omsOrderNum"
                        placeholder="行程订单号" clearable />

                    <el-input size="small" style="margin-left: 10px;width: 150px;" v-model="find_data.remark"
                        placeholder="摘要/其他费用说明" clearable />

                    <el-select size="small" multiple collapse-tags clearable v-model="companyNums"
                        :placeholder="'托管单位名称'" style="width: 150px;margin-left:10px;">
                        <template #header>
                            <el-checkbox v-model="checkAll" :indeterminate="indeterminate" @change="handleCheckAll">
                                全选
                            </el-checkbox>
                        </template>
                        <el-option v-for="item in findTrusteeshipMeComboList" :key="item.id" :label="item.companyName"
                            :value="item.companyNum">
                        </el-option>
                    </el-select>


                    <el-button size="small" style="margin-left: 20px;margin-top: 2px;" @click="search_btn"
                        type="primary" icon="Search">搜索</el-button>
                </div>
                <!-- 功能按钮 -->
                <div style="margin-top:10px;display: flex;">
                    <el-button size="small" @click="add_btn" type="primary" icon="SuccessFilled">新增</el-button>
                    <el-button size="small" @click="up_btn" type="warning" icon="WarnTriangleFilled">修改</el-button>
                    <el-button size="small" @click="del_btn" type="danger" icon="CircleCloseFilled">删除</el-button>
                    <el-button size="small" @click="checkBzRecord('CHECKED')" type="primary"
                        icon="Stamp">审核通过</el-button>
                    <el-button size="small" @click="checkBzRecord('REFUSED')" type="primary"
                        icon="Stamp">审核不通过</el-button>
                    <el-button size="small" @click="setTurnDownStaffReimMd" type="primary"
                        icon="DocumentRemove">驳回</el-button>
                    <el-button size="small" @click="Write_off_btn" type="primary" icon="DocumentCopy">核销</el-button>
                    <el-button size="small" @click="cancelWriteOff" type="primary" icon="Close">撤销核销</el-button>
                    <el-button size="small" @click="ex_getWalletListForBack_btn" type="primary"
                        icon="Download">导出</el-button>
                </div>
            </template>
            <div>
                <el-table border @header-dragend='headerdragend' @selection-change="selection_change_btn" height="50vh"
                    ref="multipleTableRef" :data="list_data" style="width: 100%">
                    <el-table-column type="selection" width="35" />
                    <el-table-column label="编号" width="55" fixed type="index" />
                    <template v-for="item in table_data_list_new" :key="item.field">
                        <el-table-column v-if="item.off" :width="item.width" :prop="item.field" :label="item.label">
                            <template v-if="item.field == 'reimVoucherUrl'" #="{ row, column, $index }">
                                <template v-if="row.reimVoucherUrl">
                                    <el-image v-for="item in row.reimVoucherUrl.split(',')"
                                        style="width: 40px; height: 40px" :preview-teleported="true"
                                        :preview-src-list="[ImageUrl + item]" :src="item ? ImageUrl + item : ''"
                                        fit="cover">
                                        <template #error>
                                            <div>
                                                <el-icon style="width: 95px; height: 95px"><icon-picture /></el-icon>
                                            </div>
                                        </template>
                                    </el-image>
                                </template>


                            </template>
                            <template v-if="item.field == 'operNote'" #="{ row, column, $index }">

                                <el-tooltip :popper-class="'route-tips'" placement="left">
                                    <template #content>{{ row.operNote }}</template>
                                    <span style="  width: 100px; white-space: nowrap; text-overflow: ellipsis; ">{{
                                        row.operNote }}</span>
                                </el-tooltip>

                            </template>
                            <template v-if="item.field == 'isCheck'" #="{ row, column, $index }">
                                <b v-if="row.isCheck == 'NO_CHECK'" style="color: #FF7300">未审核</b>
                                <b v-else-if="row.isCheck == 'CHECKED'" style="color: #008000">已审核</b>
                                <b v-else-if="row.isCheck == 'CANCELLATION'">已报销</b>
                                <b v-else style="color: red;">未通过</b>
                            </template>
                        </el-table-column>
                    </template>


                </el-table>
            </div>

            <div style="margin-top:20px">
                <el-pagination @current-change="current_change_btn" @size-change="size_change_btn"
                    v-model:current-page="find_data.page.pageNum" v-model:page-size="find_data.page.pageSize"
                    :page-sizes="[20, 50, 100, 200]" :background="true"
                    layout="prev, pager, next, jumper,->,sizes,total," :total="total" />
            </div>
        </el-card>
    </div>

    <!-- 弹窗 -->
    <div>
        <!-- 表格筛选 -->
        <div style="position: absolute;top:200px;z-index: 9999;" :style="icon_off ? 'right:0px;' : 'right:110px;'">
            <el-icon @click="icon_btn" :size="20">
                <Setting />
            </el-icon>
            <div v-show="icon_off"
                style=" position: relative;top:-100px;right:140px;width: 130px;height:430px;background:#fff;overflow: hidden;">
                <div class="cols-set" style="background:#fff;width:90%;height:97%;margin:auto;margin-top:10px;">
                    <div>
                        <el-button-group style="display: flex; ">
                            <el-tooltip effect="dark" placement="bottom">
                                <template #content>注意：拖动下面的项，可以改变表格列的顺序，<br />记得点击保存才会永久生效哦！ </template>
                                <el-button style="width:10px" type="primary" icon="WarningFilled"></el-button>
                            </el-tooltip>
                            <el-button title="重置" type="primary" icon="Refresh" @click="resetTableSet"></el-button>
                            <el-button title="保存" type="primary" icon="Check" @click="saveTableSet"></el-button>
                        </el-button-group>
                        <div ref="sortableContainer" class="col-items" style="height:400px; overflow-y: auto; ">
                            <el-checkbox class="drag_it" @change="checkbox_btn" v-for="item in sortedItems"
                                :key="item.field" v-model="item.off" :label="item.label" border>
                            </el-checkbox>
                        </div>

                    </div>
                </div>
            </div>
        </div>
        <!-- 添加修改 -->
        <el-dialog style="margin-top:5vh" v-model="add_off" :title="title" :width="winWidth"
            :close-on-click-modal='false'>

            <el-tabs v-model="active" @tab-click="onTabClick">
                <!-- <el-tab-pane :disabled="add_up_off == 1?false:true" label="团上开支" name="1">
                    <div>暂无---请期待</div>
                </el-tab-pane> -->
                <el-tab-pane :disabled="add_up_off == 1 ? false : true" label="加油报账" name="2">
                    <el-form :model="adupOilReim_submit_data" ref="adupOilReim_Ref" label-width="100px" size="medium"
                        style="margin-top: 10px">
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="加油日期" prop="payTime"
                                    :rules="[{ required: true, message: '加油日期不能为空', trigger: 'blur' }]">
                                    <el-date-picker clearable style="width: 100%"
                                        v-model="adupOilReim_submit_data.payTime" type="date" placeholder="请选择加油日期"
                                        format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />
                                </el-form-item>
                            </el-col>

                            <el-col :span="12">
                                <el-form-item label="报账车辆" prop="plateNum"
                                    :rules="[{ required: true, message: '报账车辆不能为空', trigger: 'blur' }]">
                                    <el-select style="width: 100%" v-model="adupOilReim_submit_data.plateNum" clearable
                                        filterable placeholder="请选择报账车辆">
                                        <el-option v-for="item in carNumList" :key="item.id" :label="item.plate_num"
                                            :value="item.plate_num">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="报账驾驶员" prop="reimUserId"
                                    :rules="[{ required: true, message: '报账驾驶员不能为空', trigger: 'blur' }]">
                                    <el-select @change="adupOilReim_reimUserId_change" style="width: 100%"
                                        v-model="adupOilReim_submit_data.reimUserId" clearable filterable
                                        placeholder="请搜索选择报账驾驶员">
                                        <el-option v-for="it in driverList" :key="it.id" :label="it.realName"
                                            :value="it.ftUserId">
                                            <span style="float: left">{{ it.realName }}</span>
                                            <span style="
                                        float: right;
                                        color: var(--el-text-color-secondary);
                                        font-size: 13px;
                                      ">{{ it.loginPhone }}</span>
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>

                            <el-col :span="12">
                                <el-form-item label="车辆公里数" prop="currentKilo" :rules="[
                                    { required: true, message: '公里数不能为空', trigger: 'blur' },

                                ]">
                                    <el-input placeholder="请输入车辆公里数" v-model="adupOilReim_submit_data.currentKilo">

                                        <template #suffix>
                                            <b style="color:black">公里</b>
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="加油方式" prop="oilWay"
                                    :rules="[{ required: true, message: '加油方式不能为空', trigger: 'blur' }]">
                                    <el-select style="width: 100%" v-model="adupOilReim_submit_data.oilWay" clearable
                                        placeholder="请选择加油方式">
                                        <el-option label="现金加油" value="XJ_JY"></el-option>
                                        <el-option label="油票加油" value="YP_JY"></el-option>
                                        <el-option label="油罐车加油" value="YGC_JY"></el-option>
                                        <el-option label="油卡加油" value="CZK_JY"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>

                            <el-col :span="12">
                                <el-form-item v-if="adupOilReim_submit_data.oilWay != 'XJ_JY'" label="加油站点"
                                    prop="stationId"
                                    :rules="[{ required: true, message: '加油站点不能为空', trigger: 'blur' }]">
                                    <el-select style="width: 100%" v-model="adupOilReim_submit_data.stationId" clearable
                                        placeholder="请搜索选择加油站点">

                                        <el-option v-for="(item, index) in oilOptions" :key="index"
                                            :label="item.cusCompanyName" :value="item.id">
                                            <span style="float: left">{{ item.cusCompanyName }}</span>
                                            <span style="
                                        float: right;
                                        color: var(--el-text-color-secondary);
                                        font-size: 13px;
                                      ">{{ item.cusRealName + '（' + item.cusPhone + '）' }}</span>
                                        </el-option>
                                    </el-select>

                                </el-form-item>
                                <el-form-item v-else label="加油金额" prop="reimMoney" :rules="[
                                    { required: true, message: '加油金额不能为空', trigger: 'blur' },

                                ]">
                                    <el-input placeholder="请输入车辆加油金额" v-model="adupOilReim_submit_data.reimMoney">

                                        <template #suffix>
                                            <b style="color:black">元</b>
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row v-if="adupOilReim_submit_data.oilWay != 'XJ_JY'">
                            <el-col :span="12">
                                <el-form-item label="加油数量" prop="oilRise"
                                    :rules="[{ required: true, message: '加油数量不能为空', trigger: 'blur' }]">
                                    <el-input placeholder="请输入车辆加油数量" v-model="adupOilReim_submit_data.oilRise">
                                        <template #suffix>
                                            <b style="color:black">升</b>
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="12">
                                <el-form-item label="加油金额" prop="reimMoney" :rules="[
                                    { required: true, message: '加油金额不能为空', trigger: 'blur' },

                                ]">
                                    <el-input placeholder="请输入车辆加油金额" v-model="adupOilReim_submit_data.reimMoney">
                                        <template #suffix>
                                            <b style="color:black">元</b>
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="24">
                                <el-form-item label="小票上传" prop="reimVoucherUrl"
                                    :rules="[{ required: false, message: '加油凭证不能为空', trigger: 'blur' }]">
                                    <!-- <el-upload class="avatar-uploader" :action="ImageUrl_upload"
                                        :headers="{ token: GET_TOKEN() }"
                                        :data="{ ftype: 'BACK_SET_DATA_IMG', files: rawFile_list }"
                                        :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload"
                                        :show-file-list="false">
                                        <img v-if="adupOilReim_submit_data.reimVoucherUrl"
                                            :src="ImageUrl + adupOilReim_submit_data.reimVoucherUrl" class="avatar" />
                                        <el-icon v-else class="avatar-uploader-icon">
                                            <Plus />
                                        </el-icon>
                                    </el-upload> -->

                                    <el-upload :limit="6" v-model:file-list="adupRewardPunish_rawFile_list2"
                                        style="margin-top: 10px;" class="avatar-uploader" :action="ImageUrl_upload"
                                        :headers="{ token: GET_TOKEN() }"
                                        :data="{ ftype: 'BACK_SET_DATA_IMG', files: rawFile_list1 }"
                                        list-type="picture-card" :on-remove="handleRemove1"
                                        :on-preview="handlePictureCardPreview1" :on-success="handleAvatarSuccess1"
                                        :before-upload="beforeAvatarUpload1">

                                        <el-icon class="avatar-uploader-icon">
                                            <Plus />
                                        </el-icon>
                                    </el-upload>
                                    <el-dialog v-model="dialogVisible1">
                                        <div style="width:60vh;height:60vh;margin:auto;">
                                            <img style="width:60vh;height:60vh;margin:auto;"
                                                :src="ImageUrl + dialogImageUrl1" alt="Preview Image" />
                                        </div>
                                    </el-dialog>

                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="24">
                                <el-form-item label="加油备注" prop="remark"
                                    :rules="[{ required: false, message: '加油备注不能为空', trigger: 'blur' }]">
                                    <el-input type="textarea" placeholder="请填写加油备注"
                                        v-model="adupOilReim_submit_data.remark" show-word-limit maxlength="100"
                                        :rows="4" />
                                </el-form-item>
                            </el-col>
                        </el-row>

                    </el-form>
                    <el-button @click="adupOilReim_ok_btn()" :style="'margin-left:' + winWidth_ok_btn"
                        type="primary">确认提交</el-button>
                </el-tab-pane>
                <el-tab-pane :disabled="add_up_off == 1 ? false : true" label="维修保养报账" name="3">
                    <el-button v-if="add_up_off == 1" type="primary" icon="Plus" @click="setAddNewStationMd">
                        添加维修站点
                    </el-button>
                    <el-form :model="adupRepairReim_data" ref="adupRepairReim_ref" label-width="100px" size="medium"
                        style="margin-top: 10px">
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="保养日期" prop="payTime"
                                    :rules="[{ required: true, message: '请选择保养日期', trigger: 'blur' }]">
                                    <el-date-picker clearable style="width: 100%" v-model="adupRepairReim_data.payTime"
                                        type="date" placeholder="选择日期" format="YYYY-MM-DD HH:mm:ss"
                                        value-format="YYYY-MM-DD HH:mm:ss" />
                                </el-form-item>
                            </el-col>

                            <el-col :span="12">
                                <el-form-item label="报账车辆" prop="plateNum"
                                    :rules="[{ required: true, message: '请选择报账车辆', trigger: 'blur' }]">
                                    <el-select style="width: 100%" v-model="adupRepairReim_data.plateNum" clearable
                                        filterable placeholder="请选择报账车辆">
                                        <el-option v-for="item in carNumList" :key="item.id" :label="item.plate_num"
                                            :value="item.plate_num">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="报账驾驶员" prop="reimUserId"
                                    :rules="[{ required: true, message: '请选择报账驾驶员', trigger: 'blur' }]">

                                    <el-select @change="adupRepairReim_reimUserId_change" style="width: 100%"
                                        v-model="adupRepairReim_data.reimUserId" clearable filterable
                                        placeholder="请搜索选择报账驾驶员">
                                        <el-option v-for="it in driverList" :key="it.id" :label="it.realName"
                                            :value="it.ftUserId">
                                            <span style="float: left">{{ it.realName }}</span>
                                            <span style="
                                        float: right;
                                        color: var(--el-text-color-secondary);
                                        font-size: 13px;
                                      ">{{ it.loginPhone }}</span>
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>

                            <el-col :span="12">
                                <el-form-item label="车辆公里数" prop="currentKilo" :rules="[
                                    { required: true, message: '请输入公里数', trigger: 'blur' },
                                ]">
                                    <el-input maxlength="7" placeholder="当前车辆公里数"
                                        v-model="adupRepairReim_data.currentKilo">
                                        <template #suffix>
                                            <b style="color:black">公里</b>
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="维修站点" prop="stationId"
                                    :rules="[{ required: true, message: '请选择维修站点', trigger: 'blur' }]">
                                    <el-select style="width: 100%" v-model="adupRepairReim_data.stationId" clearable
                                        filterable placeholder="维修站点">
                                        <el-option v-for="(item, index) in repairOptions" :key="index"
                                            :label="item.cusCompanyName" :value="item.id">
                                            <span style="float: left">{{ item.cusCompanyName }}</span>
                                            <span style="
                                    float: right;
                                    color: var(--el-text-color-secondary);
                                    font-size: 13px;
                                  ">{{ item.cusRealName + '（' + item.cusPhone + '）' }}</span>
                                        </el-option>
                                    </el-select>

                                </el-form-item>
                            </el-col>

                            <el-col :span="12">
                                <el-form-item label="支付方式" prop="payWay"
                                    :rules="[{ required: true, message: '请选择支付方式', trigger: 'blur' }]">
                                    <el-select style="width: 100%" v-model="adupRepairReim_data.payWay" clearable
                                        placeholder="支付方式">
                                        <el-option label="现金" value="CASH"></el-option>
                                        <!-- <el-option label="微信" value="WXPAY"></el-option> -->
                                        <el-option label="记账" value="ACCOUNTING"></el-option>

                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="维修金额" prop="reimMoney" :rules="[
                                    { required: true, message: '请输入维修金额', trigger: 'blur' },

                                ]">
                                    <el-input maxlength="6" placeholder="维修金额" v-model="adupRepairReim_data.reimMoney">

                                        <template #suffix>
                                            <b style="color:black">元</b>
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="12">
                                <el-form-item label="是否保养" prop="isMaintenance" :rules="[
                                    { required: false, message: '请输入是否保养', trigger: 'blur' },

                                ]">
                                    <el-select style="width: 100%" v-model="adupRepairReim_data.isMaintenance" clearable
                                        placeholder="请输入是否保养">
                                        <el-option label="否" value="0"></el-option>
                                        <el-option label="是" value="1"></el-option>

                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="24">
                                <el-form-item label="图片上传" prop="reimVoucherUrl"
                                    :rules="[{ required: false, message: '图片上传', trigger: 'change' },]" required>
                                    <!-- <el-upload class="avatar-uploader" :action="ImageUrl_upload"
                                    :headers="{ token: GET_TOKEN() }"
                                    :data="{ ftype: 'BACK_SET_DATA_IMG', files: rawFile_list2 }"
                                    :on-success="handleAvatarSuccess2" :before-upload="beforeAvatarUpload2"
                                    :show-file-list="false">
                                    <img v-if="adupRepairReim_data.reimVoucherUrl"
                                        :src="ImageUrl + adupRepairReim_data.reimVoucherUrl" class="avatar" />
                                    <el-icon v-else class="avatar-uploader-icon">
                                        <Plus />
                                    </el-icon>
                                </el-upload> -->
                                    <el-upload :limit="6" v-model:file-list="adupRewardPunish_rawFile_list4"
                                        style="margin-top: 10px;" class="avatar-uploader" :action="ImageUrl_upload"
                                        :headers="{ token: GET_TOKEN() }"
                                        :data="{ ftype: 'BACK_SET_DATA_IMG', files: rawFile_list2 }"
                                        list-type="picture-card" :on-remove="handleRemove2"
                                        :on-preview="handlePictureCardPreview2" :on-success="handleAvatarSuccess2"
                                        :before-upload="beforeAvatarUpload2">

                                        <el-icon class="avatar-uploader-icon">
                                            <Plus />
                                        </el-icon>
                                    </el-upload>
                                    <el-dialog v-model="dialogVisible2">
                                        <div style="width:60vh;height:60vh;margin:auto;">
                                            <img style="width:60vh;height:60vh;margin:auto;"
                                                :src="ImageUrl + dialogImageUrl2" alt="Preview Image" />
                                        </div>
                                    </el-dialog>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="24">
                                <el-form-item type="textarea" label="维修项目" prop="remark"
                                    :rules="[{ required: true, message: '请输入维修项目', trigger: 'blur' }]">
                                    <el-input type="textarea" placeholder="维修项目" v-model="adupRepairReim_data.remark"
                                        show-word-limit maxlength="100" :rows="4" />
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-button @click="adupRepairReim_ok_btn()" :style="'margin-left:' + winWidth_ok_btn"
                            type="primary">确认提交</el-button>
                    </el-form>
                </el-tab-pane>
                <el-tab-pane :disabled="add_up_off == 1 ? false : true" label="无业务开支" name="4">
                    <el-form :model="adupNoRouteReim_data" ref="adupNoRouteReim_ref" label-width="100px" size="medium"
                        style="margin-top: 10px">
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="报账车辆" prop="plateNum"
                                    :rules="[{ required: true, message: '请选择报账车辆', trigger: 'blur' }]">

                                    <el-select style="width: 100%" v-model="adupNoRouteReim_data.plateNum" clearable
                                        filterable placeholder="请选择报账车辆">
                                        <el-option v-for="item in carNumList" :key="item.id" :label="item.plate_num"
                                            :value="item.plate_num">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>

                            <el-col :span="12">
                                <el-form-item label="报账驾驶员" prop="reimUserId"
                                    :rules="[{ required: true, message: '请选择报账驾驶员', trigger: 'blur' }]">
                                    <el-select @change="adupNoRouteReim_reimUserId_change" style="width: 100%"
                                        v-model="adupNoRouteReim_data.reimUserId" clearable filterable
                                        placeholder="请搜索选择报账驾驶员">
                                        <el-option v-for="it in driverList" :key="it.id" :label="it.realName"
                                            :value="it.ftUserId">
                                            <span style="float: left">{{ it.realName }}</span>
                                            <span style="
                                        float: right;
                                        color: var(--el-text-color-secondary);
                                        font-size: 13px;
                                      ">{{ it.loginPhone }}</span>
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="车辆公里数" prop="currentKilo" :rules="[
                                    { required: true, message: '请输入公里数', trigger: 'blur' },

                                ]">
                                    <el-input maxlength="7" placeholder="当前车辆公里数"
                                        v-model="adupNoRouteReim_data.currentKilo">
                                        <template #suffix>
                                            <b style="color:black">公里</b>
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="12">
                                <el-form-item label="报账类型" prop="moneyTypeId"
                                    :rules="[{ required: true, message: '请选择报账类型', trigger: 'blur' }]">
                                    <el-select :disabled="add_up_off == 1 ? false : true" style="width: 100%"
                                        v-model="adupNoRouteReim_data.moneyTypeId" clearable placeholder="报账类型">
                                        <el-option v-for="item in getNoOrderPayMoneyTypes_list" :key="item.id"
                                            :label="item.text" :value="item.id">
                                        </el-option>
                                    </el-select>

                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="支付方式" prop="payWay"
                                    :rules="[{ required: true, message: '请选择支付方式', trigger: 'blur' }]">
                                    <el-select style="width: 100%" v-model="adupNoRouteReim_data.payWay" clearable
                                        placeholder="支付方式">
                                        <el-option label="现金" value="CASH"></el-option>
                                        <el-option label="微信" value="WXPAY"></el-option>
                                        <el-option label="记账" value="ACCOUNTING"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>

                            <el-col :span="12">
                                <el-form-item label="报账金额" prop="reimMoney" :rules="[
                                    { required: true, message: '请输入报账金额', trigger: 'blur' },
                                ]">
                                    <el-input type="number" maxlength="6" placeholder="报账金额"
                                        v-model="adupNoRouteReim_data.reimMoney">

                                        <template #suffix>
                                            <b style="color:black">元</b>
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-row>
                            <el-col :span="12">
                                <div>

                                    <el-form-item
                                        v-if="adupNoRouteReim_data.moneyTypeId == '140' || adupNoRouteReim_data.moneyTypeId == '141'"
                                        label="报账日期" prop="costStartTime"
                                        :rules="[{ required: true, message: '报账日期', trigger: 'change' }]">
                                        <el-date-picker style="width: 100%" v-model="adupNoRouteReim_timeTypeTime"
                                            @change="adupNoRouteReim_timeTypeTime_btn" type="datetimerange"
                                            start-placeholder="开始时间" end-placeholder="结束时间" format="YYYY-MM-DD HH:mm:ss"
                                            value-format="YYYY-MM-DD HH:mm:ss" />

                                    </el-form-item>
                                    <el-form-item v-else label="报账日期" prop="payTime"
                                        :rules="[{ required: true, message: '请选择报账日期', trigger: 'blur' }]">
                                        <el-date-picker clearable style="width: 100%"
                                            v-model="adupNoRouteReim_data.payTime" type="date" placeholder="选择日期"
                                            format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />
                                    </el-form-item>
                                </div>
                            </el-col>

                            <el-col :span="12">

                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="24">
                                <el-form-item label="图片上传" prop="reimVoucherUrl"
                                    :rules="[{ required: false, message: '请上传图片', trigger: 'change' }]">
                                    <!-- <el-upload class="avatar-uploader" :action="ImageUrl_upload"
                                    :headers="{ token: GET_TOKEN() }"
                                    :data="{ ftype: 'BACK_SET_DATA_IMG', files: rawFile_list3 }"
                                    :on-success="handleAvatarSuccess3" :before-upload="beforeAvatarUpload3"
                                    :show-file-list="false">
                                    <img v-if="adupNoRouteReim_data.reimVoucherUrl"
                                        :src="ImageUrl + adupNoRouteReim_data.reimVoucherUrl" class="avatar" />
                                    <el-icon v-else class="avatar-uploader-icon">
                                        <Plus />
                                    </el-icon>
                                </el-upload> -->
                                    <el-upload :limit="6" v-model:file-list="adupRewardPunish_rawFile_list6"
                                        style="margin-top: 10px;" class="avatar-uploader" :action="ImageUrl_upload"
                                        :headers="{ token: GET_TOKEN() }"
                                        :data="{ ftype: 'BACK_SET_DATA_IMG', files: rawFile_list3 }"
                                        list-type="picture-card" :on-remove="handleRemove3"
                                        :on-preview="handlePictureCardPreview3" :on-success="handleAvatarSuccess3"
                                        :before-upload="beforeAvatarUpload3">

                                        <el-icon class="avatar-uploader-icon">
                                            <Plus />
                                        </el-icon>
                                    </el-upload>
                                    <el-dialog v-model="dialogVisible3">
                                        <div style="width:60vh;height:60vh;margin:auto;">
                                            <img style="width:60vh;height:60vh;margin:auto;"
                                                :src="ImageUrl + dialogImageUrl3" alt="Preview Image" />
                                        </div>
                                    </el-dialog>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="24">
                                <el-form-item label="报账备注" prop="remark"
                                    :rules="[{ required: true, message: '请输入报账备注', trigger: 'blur' }]">
                                    <el-input type="textarea" placeholder="报账备注" v-model="adupNoRouteReim_data.remark"
                                        show-word-limit maxlength="100" :rows="4" />
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-button @click="adupNoRouteReim_data_ok_btn()" :style="'margin-left:' + winWidth_ok_btn"
                            type="primary">确认提交</el-button>
                    </el-form>
                </el-tab-pane>
                <el-tab-pane :disabled="add_up_off == 1 ? false : true" label="审车报账" name="5">

                    <el-form :model="adupCheckCarFee_data" ref="adupCheckCarFee_ref" label-width="100px" size="medium"
                        style="margin-top: 10px">
                        <el-row>


                            <el-col :span="12">
                                <el-form-item label="报账车辆" prop="plateNum"
                                    :rules="[{ required: true, message: '请选择报账车辆', trigger: 'blur' }]">
                                    <el-select style="width: 100%" v-model="adupCheckCarFee_data.plateNum" clearable
                                        filterable placeholder="请选择报账车辆">
                                        <el-option v-for="item in carNumList" :key="item.id" :label="item.plate_num"
                                            :value="item.plate_num">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="报账驾驶员" prop="reimUserId"
                                    :rules="[{ required: true, message: '请选择报账驾驶员', trigger: 'blur' }]">

                                    <el-select @change="adupCheckCarFee_change" style="width: 100%"
                                        v-model="adupCheckCarFee_data.reimUserId" clearable filterable
                                        placeholder="请搜索选择报账驾驶员">
                                        <el-option v-for="it in driverList" :key="it.id" :label="it.realName"
                                            :value="it.ftUserId">
                                            <span style="float: left">{{ it.realName }}</span>
                                            <span style="
                                        float: right;
                                        color: var(--el-text-color-secondary);
                                        font-size: 13px;
                                      ">{{ it.loginPhone }}</span>
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-row>


                            <el-col :span="12">
                                <el-form-item label="车辆公里数" prop="currentKilo" :rules="[
                                    { required: true, message: '请输入公里数', trigger: 'blur' },
                                ]">
                                    <el-input maxlength="7" placeholder="当前车辆公里数"
                                        v-model="adupCheckCarFee_data.currentKilo">
                                        <template #suffix>
                                            <b style="color:black">公里</b>
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="支付方式" prop="payWay"
                                    :rules="[{ required: true, message: '请选择支付方式', trigger: 'blur' }]">
                                    <el-select style="width: 100%" v-model="adupCheckCarFee_data.payWay" clearable
                                        placeholder="支付方式">
                                        <el-option label="现金" value="CASH"></el-option>
                                        <!-- <el-option label="微信" value="WXPAY"></el-option> -->
                                        <el-option label="记账" value="ACCOUNTING"></el-option>

                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="支付日期" prop="payTime"
                                    :rules="[{ required: true, message: '请选择支付日期', trigger: 'blur' }]">
                                    <el-date-picker clearable style="width: 100%" v-model="adupCheckCarFee_data.payTime"
                                        type="date" placeholder="选择日期" format="YYYY-MM-DD HH:mm:ss"
                                        value-format="YYYY-MM-DD HH:mm:ss" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="到期时间" prop="expireTime"
                                    :rules="[{ required: true, message: '请选择下次到期时间', trigger: 'blur' }]">
                                    <el-date-picker clearable style="width: 100%"
                                        v-model="adupCheckCarFee_data.expireTime" type="date" placeholder="选择日期"
                                        format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />
                                </el-form-item>
                            </el-col>




                        </el-row>

                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="审车金额" prop="reimMoney" :rules="[
                                    { required: true, message: '请输入审车金额', trigger: 'blur' },

                                ]">
                                    <el-input maxlength="6" placeholder="审车金额" v-model="adupCheckCarFee_data.reimMoney">

                                        <template #suffix>
                                            <b style="color:black">元</b>
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="提前提醒" prop="remindDays" :rules="[
                                    { required: true, message: '请输入提前提醒天数', trigger: 'blur' },

                                ]">
                                    <el-input placeholder="提前提醒天数" v-model="adupCheckCarFee_data.remindDays">

                                        <template #suffix>
                                            <b style="color:black">天</b>
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </el-col>


                        </el-row>
                        <el-row>
                            <el-col :span="24">
                                <el-form-item label="图片上传" prop="reimVoucherUrl"
                                    :rules="[{ required: false, message: '图片上传', trigger: 'change' },]" required>

                                    <el-upload :limit="6" v-model:file-list="adupRewardPunish_rawFile_list8"
                                        style="margin-top: 10px;" class="avatar-uploader" :action="ImageUrl_upload"
                                        :headers="{ token: GET_TOKEN() }"
                                        :data="{ ftype: 'BACK_SET_DATA_IMG', files: rawFile_list4 }"
                                        list-type="picture-card" :on-remove="handleRemove4"
                                        :on-preview="handlePictureCardPreview4" :on-success="handleAvatarSuccess4"
                                        :before-upload="beforeAvatarUpload4">

                                        <el-icon class="avatar-uploader-icon">
                                            <Plus />
                                        </el-icon>
                                    </el-upload>
                                    <el-dialog v-model="dialogVisible4">
                                        <div style="width:60vh;height:60vh;margin:auto;">
                                            <img style="width:60vh;height:60vh;margin:auto;"
                                                :src="ImageUrl + dialogImageUrl4" alt="Preview Image" />
                                        </div>
                                    </el-dialog>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="24">
                                <el-form-item type="textarea" label="备注" prop="remark"
                                    :rules="[{ required: true, message: '请输入备注', trigger: 'blur' }]">
                                    <el-input type="textarea" placeholder="备注" v-model="adupCheckCarFee_data.remark"
                                        show-word-limit maxlength="100" :rows="4" />
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-button @click="adupCheckCarFee_ok_btn()" :style="'margin-left:' + winWidth_ok_btn"
                            type="primary">确认提交</el-button>
                    </el-form>
                </el-tab-pane>
            </el-tabs>

        </el-dialog>
        <!-- 维修站 -->
        <el-dialog style="margin-top:5vh" v-model="setAddNewStationMd_off" title="添加维修站" width="40%"
            :close-on-click-modal='false'>
            <el-form :model="addRepairCustom_data" ref="addRepairCustom_ref" label-width="100px">
                <el-form-item label="维修厂名称" prop="cusCompanyName"
                    :rules="[{ required: true, message: '维修厂名称不能为空', trigger: 'blur' }]">
                    <el-input placeholder="维修厂名称" v-model="addRepairCustom_data.cusCompanyName" />
                </el-form-item>
                <el-form-item label="联系人" prop="cusRealName"
                    :rules="[{ required: true, message: '联系人不能为空', trigger: 'blur' }]">
                    <el-input placeholder="联系人" v-model="addRepairCustom_data.cusRealName" />
                </el-form-item>

                <el-form-item label="联系电话" prop="cusPhone"
                    :rules="[{ required: true, message: '联系电话不能为空', trigger: 'blur' }]">
                    <el-input maxlength="11" placeholder="联系电话" v-model="addRepairCustom_data.cusPhone" />
                </el-form-item>
                <el-form-item label="主营业务" prop="serviceContent"
                    :rules="[{ required: true, message: '主营业务不能为空', trigger: 'blur' }]">
                    <el-input placeholder="请输入主营业务" v-model="addRepairCustom_data.serviceContent" />
                </el-form-item>

                <el-form-item label="地址" prop="address"
                    :rules="[{ required: true, message: '地点位置不能为空', trigger: 'blur' }]">
                    <el-autocomplete ref="mpAtInp" prefix-icon="MapLocation" popper-class="my-autocomplete" clearable
                        :popper-append-to-body="false" placeholder="请输入地点关键字" :fetch-suggestions="querySearchAsync"
                        @select="handleSelect" v-model="addRepairCustom_data.address">
                        <template #default="{ item }">
                            <div class="name" :title="item.name.length > 20 ? item.name : ''">
                                {{ item.name }}
                                <span class="c-yellow" v-if="item.type == 4">（虚拟）</span>
                            </div>
                            <span class="addr">
                                <template v-if="item.type == 4">无准确地址选择此项</template>
                                <template v-else>{{ item.address }}（{{ item.area }}）</template>
                            </span>
                            <i v-if="item.isSta" class="sta-icon">站</i>
                        </template>
                    </el-autocomplete>
                </el-form-item>
            </el-form>
            <el-button @click="setAddNewStationMd_ok_btn()" style="margin-left:30vw" type="primary">确认提交</el-button>
        </el-dialog>
        <!-- 驳回 -->
        <el-dialog style="margin-top:5vh" v-model="setTurnDownStaffReimMd_off" title="报账驳回" width="40%"
            :close-on-click-modal='false'>
            <el-form :model="setTurnDownStaffReimMd_data" ref="setTurnDownStaffReimMd_ref" label-width="100px">
                <el-form-item label="拒绝原因" prop="refuseReason"
                    :rules="[{ required: true, message: '请输入拒绝原因', trigger: 'blur' }]">
                    <el-input v-model="setTurnDownStaffReimMd_data.refuseReason" type="textarea" :rows="4"
                        resize="none" />
                </el-form-item>
            </el-form>
            <el-button @click="setTurnDownStaffReimMd_ok_btn1()" style="margin-left:30vw"
                type="primary">确认提交</el-button>
        </el-dialog>
        <!-- 核销 -->
        <el-dialog style="margin-top:5vh" v-model="Write_off" title="报账核销" width="80%" :close-on-click-modal='false'>
            <div class="filter-container">
                <div class="dgts-row">
                    <el-form :model="Write_data" ref="cancelStaffReimTb" :inline="true" style="margin-right: 20px;">
                        <el-form-item label="入账月份">
                            <el-date-picker v-model="Write_data.enterTime" type="month" placeholder="入账月份"
                                format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width: 120px;" />
                        </el-form-item>

                        <el-button type="primary" icon="SuccessFilled" @click="Write_ok_btn">
                            确定核销
                        </el-button>
                    </el-form>

                    <div class="dgts-text-tj1">
                        <b class="tr-it c-green">累计</b>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-green">收入：{{ Write_totalshou }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">支出：{{ Write_totalPay }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-yellow">收支差额：{{ Write_totalcha }} 元</span>
                    </div>

                    <div class="dgts-text-tj2">
                        <b class="tr-it c-green">所选</b>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-green">收入：{{ Write_seledGath }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-red">支出：{{ Write_seledPay }} 元</span>
                        <el-divider direction="vertical"></el-divider>
                        <span class="tr-it c-yellow">收支差额：{{ Write_seledBalance }} 元</span>
                    </div>
                </div>
                <el-divider></el-divider>
                <div class="dgts-row">
                    <el-form :model="Write_data__find_list" :inline="true">
                        <el-form-item>
                            <el-select v-model="Write_data__find_list.timeType" placeholder="时间类型"
                                style="width: 100px;">
                                <el-option label="添加时间" value="0"></el-option>
                                <el-option label="发生时间" value="1"></el-option>
                            </el-select>
                        </el-form-item>

                        <el-form-item>

                            <el-date-picker style="width: 330px;height:30px" v-model="Write_timeTypeTime"
                                @change="Write_timeTypeTime_btn" type="datetimerange" start-placeholder="开始时间"
                                end-placeholder="结束时间" format="YYYY-MM-DD HH:mm:ss"
                                value-format="YYYY-MM-DD HH:mm:ss" />
                        </el-form-item>

                        <el-form-item>
                            <el-input placeholder="交易金额" clearable maxlength="6"
                                v-model="Write_data__find_list.tradeMoney" style="width: 100px;" />
                        </el-form-item>

                        <el-form-item>

                            <el-select style="width: 130px;" v-model="Write_data__find_list.moneyTypeIds" clearable
                                filterable placeholder="金额类型">
                                <el-option v-for="item in reimTypeOptions" :key="item.id" :label="item.text"
                                    :value="item.id">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item>

                            <el-select clearable v-model="Write_data__find_list.tradeStatus" placeholder="收支类型"
                                style="width: 100px;">
                                <el-option label="收入" value="0"></el-option>
                                <el-option label="支出" value="1"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item>
                            <el-input placeholder="对方户名" clearable v-model="Write_data__find_list.transName"
                                style="width: 120px;" />
                        </el-form-item>

                        <el-form-item style="width: 200px;">
                            <el-input placeholder="摘要" clearable v-model="Write_data__find_list.remark" />
                        </el-form-item>

                        <el-form-item>
                            <el-button type="primary" icon="Search" @click="Write_find_btn">
                                搜索
                            </el-button>
                        </el-form-item>

                    </el-form>
                </div>
            </div>
            <div>
                <el-table border @selection-change="selection_change_btn2" height="58vh" ref="multipleTableRef2"
                    :data="Write_data__list" style="width: 100%">
                    <el-table-column type="selection" width="35" />
                    <el-table-column label="编号" width="55" fixed type="index" />
                    <el-table-column prop="tradeTime" label="交易时间" width="165" />
                    <el-table-column prop="moneyTypeName" label="金额类型" width="120" />
                    <el-table-column prop="myBankName" label="银行名称" width="140" />
                    <el-table-column label="报销状态" width="100">
                        <template #="{ row, column, $index }">
                            {{ row.isCheck == 'NO_CHECK' ? '未操作' : row.isCheck == 'CANCELLATION' ? '已报销' : row.isCheck
                                ==
                                'SETTLED' ? '已结算' : '无' }}
                        </template>

                    </el-table-column>

                    <el-table-column prop="transName" label="对方户名" width="110" />
                    <el-table-column prop="tradeInMoney" label="借" width="80" />
                    <el-table-column prop="tradeOutMoney" label="贷" width="80" />
                    <el-table-column prop="balance" label="余额" width="90" />
                    <el-table-column prop="remark" label="摘要" width="" />

                </el-table>
            </div>

            <div style="margin-top:20px">
                <el-pagination @current-change="Write_current_change_btn" @size-change="Write_size_change_btn"
                    v-model:current-page="Write_data__find_list.page.pageNum"
                    v-model:page-size="Write_data__find_list.page.pageSize" :page-sizes="[20, 50, 100, 200]"
                    :background="true" layout="prev, pager, next, jumper,->,sizes,total,"
                    :total="Write_data__find_list_total" />
            </div>
        </el-dialog>
    </div>
</template>

<script setup>
import Sortable from 'sortablejs';
import { GET_TOKEN } from '@/utils/token.js'
import { ref, reactive, onMounted, computed, watch } from 'vue'
import {
    adupPrivateSet, getPrivateSetList, findStaffReimList, addStaffReimburse, findStaffCombo, findComboCusList,
    findMtypeCombo, modifyStaffReimburse, checkStaffReimburse, checkRefuse, findBankTradeList, cancellationStaffReim,
    cancelStaffReim, delStaffReim, findAllDeptList, findCarCombo, adupCompanyVehicle, staffReimExport, adupOilReim,
    getDriverList, addRepairCustom, findMapPointList, adupRepairReim, adupNoRouteReim, getDriverMoneyTypes, getNoOrderPayMoneyTypes,
    adupCheckCarFee, findTrusteeshipMeCombo

} from '@/api/financial_center.js'
import { ElMessage, ElLoading, ElMessageBox } from 'element-plus'
import { importCusCheckInData, ImageUrl_upload, ImageUrl, line2treeData } from '@/utils/common.js'
import * as XLSX from 'xlsx';
import CircularJSON from 'circular-json'
onMounted(async () => {
    // let employee_reimbursement2 = JSON.parse(localStorage.getItem('employee_reimbursement2'))
    // if (employee_reimbursement2) {
    //     find_data.find = employee_reimbursement2.find
    // }
    getPrivateSetList({
        find: '驾驶员报账',
        page: {
            pageNum: 1,
            pageSize: 20,
        },
    }).then(res => {
        if (res.data.list[0]) {
            table_data_list_new.value = JSON.parse(res.data.list[res.data.list.length - 1].dat)
        } else {
            console.log('no')
            table_data_list_new.value = table_data_list
        }
    })

    Sortable.create(sortableContainer.value, {
        draggable: '.drag_it',
        ghostClass: 'sortable-ghost',
        onEnd: evt => {
            const targetRow = table_data_list_new.value.splice(evt.oldIndex, 1)[0];
            table_data_list_new.value.splice(evt.newIndex, 0, targetRow);
        }
    })

    findStaffCombo({ staffStates: 'NORMAL,TRY' }).then(res => {
        serviceManList.value = res.data || [];
    })

    getDriverMoneyTypes({}).then(res => {
        reimTypeOptions.value = res.data || [];
    })
    getNoOrderPayMoneyTypes({}).then(res => {
        getNoOrderPayMoneyTypes_list.value = res.data || [];
    })

    findAllDeptList({}).then(res => {
        findAllDeptList_list.value = res.data
        findAllDeptList_list.value = line2treeData(findAllDeptList_list.value, 'pid')
        findAllDeptList_list.value = findAllDeptList_list.value[0].children
    })

    findTrusteeshipMeCombo({
        page: {
            pageNum: 1,
            pageSize: 999,
        },
        companyName: '',
    }).then(res => {
        let luser = JSON.parse(localStorage.getItem("luser"))
        let luser_companyNum = luser.companyNum
        let companyNums = [luser_companyNum]
        if (res.data) {
            for (let i = 0; i < res.data.length; i++) {
                console.log(res.data[i].companyNum)
                companyNums.push(res.data[i].companyNum)
            }
        }
        findCarCombo({
            page: {
                pageNum: 1,
                pageSize: 999,
            },
            plateNum: '',
            companyNums: companyNums,
        }).then(res => {

            carNumList.value = res.data.list || [];
        })
    })


    findComboCusList({
        cusTypeId: 9,
        page: {
            pageNum: 1,
            pageSize: 999,
        },
    }).then(res => {
        oilOptions.value = res.data
    })

    getDriverList({
        containLeave: '0',
        containMain: "0",
    }).then(res => {
        driverList.value = res.data
    })

    findComboCusList({
        cusTypeId: 8,
        page: {
            pageNum: 1,
            pageSize: 999,
        },
    }).then(res => {
        repairOptions.value = res.data
    })
    findTrusteeshipMeCombo({
        page: {
            pageNum: 1,
            pageSize: 999,
        },
        companyName: '',
    }).then(res => {
        findTrusteeshipMeComboList.value = res.data || [];
    })


    setTimeout(() => {
        for (let i = 0; i < findTrusteeshipMeComboList.value.length; i++) {
            companyNums.value.push(findTrusteeshipMeComboList.value[i].companyNum)
        }
        checkAll.value = true
        list_api()
    }, 500);

    company.value = JSON.parse(localStorage.getItem("company"))
    isTrustee.value = company.value.isTrustee

})

const checkAll = ref(false)
const indeterminate = ref(false)
const findTrusteeshipMeComboList = ref([])
const companyNums = ref([])
watch(companyNums, (val) => {

    if (val.length === 0) {
        checkAll.value = false
        indeterminate.value = false
    } else if (val.length === findTrusteeshipMeComboList.value.length) {
        checkAll.value = true
        indeterminate.value = false
    } else {
        indeterminate.value = true
    }
})
const handleCheckAll = (val) => {
    indeterminate.value = false
    if (val) {
        companyNums.value = findTrusteeshipMeComboList.value.map((_) => _.companyNum)
    } else {
        companyNums.value = []
    }

}


//#region 是否托管
const company = ref({})
const isTrustee = ref(0)
//#endregion

// 上传图片
const adupRewardPunish_rawFile_list = ref([])
const adupRewardPunish_rawFile_list2 = ref([])

const adupRewardPunish_rawFile_list3 = ref([])
const adupRewardPunish_rawFile_list4 = ref([])

const adupRewardPunish_rawFile_list5 = ref([])
const adupRewardPunish_rawFile_list6 = ref([])

const adupRewardPunish_rawFile_list7 = ref([])
const adupRewardPunish_rawFile_list8 = ref([])
const handleRemove1 = (uploadFile, uploadFiles) => {
    let url_data = uploadFile.response.data.file.url

    for (let i = 0; i < adupRewardPunish_rawFile_list.value.length; i++) {
        if (adupRewardPunish_rawFile_list.value[i] == url_data) {
            adupRewardPunish_rawFile_list.value.splice(i, 1);
        }
    }
}
const handleRemove2 = (uploadFile, uploadFiles) => {
    let url_data = uploadFile.response.data.file.url

    for (let i = 0; i < adupRewardPunish_rawFile_list3.value.length; i++) {
        if (adupRewardPunish_rawFile_list3.value[i] == url_data) {
            adupRewardPunish_rawFile_list3.value.splice(i, 1);
        }
    }
}
const handleRemove3 = (uploadFile, uploadFiles) => {
    let url_data = uploadFile.response.data.file.url

    for (let i = 0; i < adupRewardPunish_rawFile_list5.value.length; i++) {
        if (adupRewardPunish_rawFile_list5.value[i] == url_data) {
            adupRewardPunish_rawFile_list5.value.splice(i, 1);
        }
    }
}
const handleRemove4 = (uploadFile, uploadFiles) => {
    let url_data = uploadFile.response.data.file.url

    for (let i = 0; i < adupRewardPunish_rawFile_list7.value.length; i++) {
        if (adupRewardPunish_rawFile_list7.value[i] == url_data) {
            adupRewardPunish_rawFile_list7.value.splice(i, 1);
        }
    }
}
const dialogImageUrl1 = ref('')
const dialogImageUrl2 = ref('')
const dialogImageUrl3 = ref('')
const dialogImageUrl4 = ref('')
const dialogVisible1 = ref(false)
const dialogVisible2 = ref(false)
const dialogVisible3 = ref(false)
const dialogVisible4 = ref(false)
const handlePictureCardPreview1 = (uploadFile) => {

    if (uploadFile.response) {
        dialogImageUrl1.value = uploadFile.response.data.file.url
    } else {


        dialogImageUrl1.value = uploadFile.url.split('https://cba360.com')[1]
    }

    dialogVisible1.value = true
}
const handlePictureCardPreview2 = (uploadFile) => {

    if (uploadFile.response) {
        dialogImageUrl2.value = uploadFile.response.data.file.url
    } else {


        dialogImageUrl2.value = uploadFile.url.split('https://cba360.com')[1]
    }

    dialogVisible2.value = true
}
const handlePictureCardPreview3 = (uploadFile) => {

    if (uploadFile.response) {
        dialogImageUrl3.value = uploadFile.response.data.file.url
    } else {


        dialogImageUrl3.value = uploadFile.url.split('https://cba360.com')[1]
    }

    dialogVisible3.value = true
}
const handlePictureCardPreview4 = (uploadFile) => {

    if (uploadFile.response) {
        dialogImageUrl4.value = uploadFile.response.data.file.url
    } else {


        dialogImageUrl4.value = uploadFile.url.split('https://cba360.com')[1]
    }

    dialogVisible4.value = true
}
const handleAvatarSuccess1 = (response, uploadFile) => {

    adupRewardPunish_rawFile_list.value.push(response.data.file.url)

}
const handleAvatarSuccess2 = (response, uploadFile) => {

    adupRewardPunish_rawFile_list3.value.push(response.data.file.url)

}
const handleAvatarSuccess3 = (response, uploadFile) => {

    adupRewardPunish_rawFile_list5.value.push(response.data.file.url)

}
const handleAvatarSuccess4 = (response, uploadFile) => {

    adupRewardPunish_rawFile_list7.value.push(response.data.file.url)

}
const rawFile_list1 = ref([])
const rawFile_list2 = ref([])
const rawFile_list3 = ref([])
const rawFile_list4 = ref([])
const beforeAvatarUpload1 = (rawFile) => {
    rawFile_list1.value = []
    if (rawFile.type == 'image/jpeg' || rawFile.type == 'image/png' || rawFile.type == 'image/gif') {
        if (rawFile.size / 1024 / 1024 > 5) {
            ElMessage.error('图片大小不能大于5M!')
            return false
        }
    } else {
        ElMessage.error('请上传图片!')
        return false
    }

    rawFile_list1.value.push(rawFile)
    return true

}
const beforeAvatarUpload2 = (rawFile) => {
    rawFile_list2.value = []
    if (rawFile.type == 'image/jpeg' || rawFile.type == 'image/png' || rawFile.type == 'image/gif') {
        if (rawFile.size / 1024 / 1024 > 5) {
            ElMessage.error('图片大小不能大于5M!')
            return false
        }
    } else {
        ElMessage.error('请上传图片!')
        return false
    }

    rawFile_list2.value.push(rawFile)
    return true

}
const beforeAvatarUpload3 = (rawFile) => {
    rawFile_list3.value = []
    if (rawFile.type == 'image/jpeg' || rawFile.type == 'image/png' || rawFile.type == 'image/gif') {
        if (rawFile.size / 1024 / 1024 > 5) {
            ElMessage.error('图片大小不能大于5M!')
            return false
        }
    } else {
        ElMessage.error('请上传图片!')
        return false
    }

    rawFile_list3.value.push(rawFile)
    return true

}
const beforeAvatarUpload4 = (rawFile) => {
    rawFile_list4.value = []
    if (rawFile.type == 'image/jpeg' || rawFile.type == 'image/png' || rawFile.type == 'image/gif') {
        if (rawFile.size / 1024 / 1024 > 5) {
            ElMessage.error('图片大小不能大于5M!')
            return false
        }
    } else {
        ElMessage.error('请上传图片!')
        return false
    }

    rawFile_list4.value.push(rawFile)
    return true

}


const defaultTime = [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]
const getNoOrderPayMoneyTypes_list = ref([])
//#region 表格数据处理

const table_data_list = reactive([
    // { label: '收款人信息', field: 'reimUser', width: 150, off: true },
    // { label: '经办人信息', field: 'operName', width: 150, off: true },
    // { label: '报账类型', field: 'moneyTypeName', width: 110, off: true },
    // { label: '报账状态', field: 'isCheck', width: 110, off: true },
    // { label: '添加时间', field: 'addTime', width: 170, off: true },
    // { label: '报账部门', field: 'deptName', width: 100, off: true },
    // { label: '驳回原因', field: 'refuseReason', width: 220, off: true },
    // { label: '图片', field: 'reimVoucherUrl', width: 100, off: true },
    // { label: '车牌号', field: 'plateNum', width: 100, off: true },
    // { label: '支出金额', field: 'reimMoney', width: 100, off: true },
    // { label: '支出金额详情', field: 'reimMoneyDetail', width: 120, off: true },
    // // { label: '收款人单位名称', field: 'cusCompanyName', width: '100', off: true },
    // { label: '订单号', field: 'orderNum', width: 100, off: true },
    // { label: '行程详情', field: 'routeDetail', width: 100, off: true },
    // { label: '行程开始日期', field: 'routeSdate', width: 110, off: true },
    // { label: '行程结束日期', field: 'routeEdate', width: 110, off: true },
    // { label: '是否高速', field: 'isDeep', width: 100, off: true },
    // { label: '行程备注', field: 'routeRemark', width: 100, off: true },
    // { label: '车辆公里数', field: 'currentKilo', width: 100, off: true },




    // { label: '操作标识', field: 'operMark', width: 200, off: true },



    { label: '经办人信息', field: 'operName', width: 100, off: true },
    { label: '收款人信息', field: 'reimUser', width: 160, off: true },
    // { label: '收款人单位名称', field: 'cusCompanyName', width: '100', off: true },
    // { label: '车公司信息', field: 'carOrderReim', width: 100, off: true },
    { label: '车牌号', field: 'plateNum', width: 100, off: true },
    { label: '车辆公里数', field: 'currentKilo', width: 100, off: true },
    { label: '业务部门', field: 'deptName', width: 100, off: true },
    { label: '报账详情', field: 'remark', width: 220, off: true },
    { label: '凭证图片', field: 'reimVoucherUrl', width: 200, off: true },
    { label: '支出金额', field: 'reimMoney', width: 100, off: true },
    { label: '支出金额详情', field: 'reimMoneyDetail', width: 120, off: true },
    { label: '记账审核状态', field: 'isCheck', width: 110, off: true },
    { label: '驳回原因', field: 'refuseReason', width: 220, off: true },
    { label: '报账类型', field: 'moneyTypeName', width: 110, off: true },
    { label: '支付日期', field: 'payTime', width: 170, off: true },
    { label: '费用产生日期', field: 'costStartTime', width: 170, off: true },
    { label: '费用结束日期', field: 'costEndTime', width: 170, off: true },
    { label: '入账月份', field: 'enterTime', width: 170, off: true },
    { label: '下次到期时间', field: 'expireTime', width: 170, off: true },
    { label: '提前提醒天数', field: 'remindDays', width: 170, off: true },
    { label: '添加时间', field: 'addTime', width: 170, off: true },

    { label: '操作标识', field: 'operMark', width: 100, off: true },
    { label: '操作备注', field: 'operNote', width: 220, off: true },

])

const table_data_list_new = ref([])
const icon_off = ref(false)
// 创建排序容器的引用
const sortableContainer = ref('')

const icon_btn = () => {
    icon_off.value = !icon_off.value
    console.log(sortableContainer.value)

}
const resetTableSet = () => {
    console.log(table_data_list)
    table_data_list_new.value = JSON.parse(JSON.stringify(table_data_list))
    console.log(table_data_list)
    console.log(table_data_list_new.value)
}
const saveTableSet = () => {
    adupPrivateSet({
        dat: JSON.stringify(table_data_list_new.value),
        tbName: '驾驶员报账',
        tbNum: "employee_reimbursement2",
    }).then(res => {
        if (res.code == 1) {
            return ElMessage({
                message: res.msg,
                type: 'success',
            })
        } else {
            return ElMessage({
                message: res.msg,
                type: 'warning',
            })
        }
    })
    icon_off.value = false
}

const checkbox_btn = (e, c) => {
    for (let i = 0; i < table_data_list_new.value.length; i++) {
        if (table_data_list_new.value[i].label == c.target._value) {
            table_data_list_new.value[i].off == e

        }

    }

}

const sortedItems = computed(() => {
    return [...table_data_list_new.value].sort((a, b) => a.id - b.id);
})
//#endregion

//#region 分页列表
const carNumList = ref([])
const driverList = ref([])


const findAllDeptList_list = ref([])
const handleChange_find = (valarr) => {
    console.log(valarr, 'valarr')
    let data = []
    for (let i = 0; i < valarr.length; i++) {

        data.push(valarr[i][valarr[i].length - 1])
    }
    find_data.deptIds = data.join(',')

}

const timeTypeTime = ref('')
const timeTypeTime_btn = (e) => {
    if (e) {
        timeTypeTime.value = e
        find_data.stime = timeTypeTime.value[0]
        find_data.etime = timeTypeTime.value[1]
    } else {
        timeTypeTime.value = ''
        find_data.stime = ''
        find_data.etime = ''
    }
}
const list_data = ref([])
const find_data = reactive({
    page: {
        pageNum: 1,
        pageSize: 20,
    },
    deptIds: '',
    stime: '',
    etime: '',
    moneyTypeIds: [],
    operMark: '',
    operUserId: '',
    omsOrderNum: '',
    plateNum: '',
    reimMoney: '',
    reimStatus: ['NO_CHECK', 'CHECKED'],
    reimUser: '',
    tradeStatus: '1',
    staffReimWay: '1',
    timeType: '1',
    companyNums: [],
})
const total = ref(0)

// 分页器一夜显示多少数据页面
const size_change_btn = () => {
    find_data.page.pageNum = 1
    list_api()
}

// 分页器跳转页面
const current_change_btn = () => {
    list_api()
}
// const seledOtherFee1 = computed(() => {
//     let money = 0, rows =  table_list.value;
//       rows.forEach(it => { it.orderTrade && (money += parseFloat(it.orderTrade.otherFee)); });
//       return (money).toFixed(2);
// })
// const seledGath = computed(() => {
//     let money = 0, rows =  table_list.value;
//       rows.forEach(it => { it.orderTrade && (money += parseFloat(it.orderTrade.otherFee)); });
//       return (money).toFixed(2);
// })
const seledPay = computed(() => {
    let money = 0, rows = table_list.value;

    rows.forEach(it => { it.reimMoney && (money += parseFloat(it.reimMoney)); });
    return (money).toFixed(2);
})
const totalGath = computed(() => {
    let money = 0, rows = table_list.value;
    rows.forEach(it => { it.totalGath && (money += parseFloat(it.totalGath)); });
    return (money).toFixed(2);
})
const taxiFee = computed(() => {
    let money = 0;
    let rows = table_list.value;
    for (let i = 0; i < rows.length; i++) {
        if (rows[i].moneyTypeName.includes('打的')) {
            if (rows[i].reimMoney) {
                money += parseFloat(rows[i].reimMoney)
            }


        }

    }
    return (money).toFixed(2);
})
const oilFee = computed(() => {


    let money = 0;
    let rows = table_list.value;
    for (let i = 0; i < rows.length; i++) {
        if (rows[i].moneyTypeName.includes('燃油')) {
            if (rows[i].reimMoney) {
                money += parseFloat(rows[i].reimMoney)
            }


        }

    }
    return (money).toFixed(2);


})
const singleFee = computed(() => {
    let money = 0;
    let rows = table_list.value;
    for (let i = 0; i < rows.length; i++) {
        if (rows[i].moneyTypeName.includes('打单')) {
            if (rows[i].reimMoney) {
                money += parseFloat(rows[i].reimMoney)
            }


        }

    }
    return (money).toFixed(2);
})
const washingFee = computed(() => {
    let money = 0;
    let rows = table_list.value;
    for (let i = 0; i < rows.length; i++) {
        if (rows[i].moneyTypeName.includes('洗车')) {
            if (rows[i].reimMoney) {
                money += parseFloat(rows[i].reimMoney)
            }


        }

    }
    return (money).toFixed(2);
})
const parkingFee = computed(() => {
    let money = 0;
    let rows = table_list.value;
    for (let i = 0; i < rows.length; i++) {
        if (rows[i].moneyTypeName.includes('停车')) {
            if (rows[i].reimMoney) {
                money += parseFloat(rows[i].reimMoney)
            }


        }

    }
    return (money).toFixed(2);
})
const roadFee = computed(() => {


    let money = 0;
    let rows = table_list.value;
    for (let i = 0; i < rows.length; i++) {
        if (rows[i].moneyTypeName.includes('过路')) {
            if (rows[i].reimMoney) {
                money += parseFloat(rows[i].reimMoney)
            }


        }

    }
    return (money).toFixed(2);
})
const livingFee = computed(() => {
    let money = 0;
    let rows = table_list.value;
    for (let i = 0; i < rows.length; i++) {
        if (rows[i].moneyTypeName.includes('用餐')) {
            if (rows[i].reimMoney) {
                money += parseFloat(rows[i].reimMoney)
            }


        }

    }
    return (money).toFixed(2);
})
const waterFee = computed(() => {
    let money = 0;
    let rows = table_list.value;
    for (let i = 0; i < rows.length; i++) {
        if (rows[i].moneyTypeName.includes('买水')) {
            if (rows[i].reimMoney) {
                money += parseFloat(rows[i].reimMoney)
            }


        }

    }
    return (money).toFixed(2);
})
const stayFee = computed(() => {
    let money = 0;
    let rows = table_list.value;
    for (let i = 0; i < rows.length; i++) {
        if (rows[i].moneyTypeName.includes('住宿')) {
            if (rows[i].reimMoney) {
                money += parseFloat(rows[i].reimMoney)
            }


        }

    }
    return (money).toFixed(2);
})
const otherFee = computed(() => {
    let money = 0;
    let rows = table_list.value;
    for (let i = 0; i < rows.length; i++) {
        if (rows[i].moneyTypeName.includes('其他')) {
            if (rows[i].reimMoney) {
                money += parseFloat(rows[i].reimMoney)
            }


        }

    }
    return (money).toFixed(2);
})

// 1111
const dg = reactive({
    totalGath: 0,
    totalPay: 0,
    singleFee: 0,
    washingFee: 0,
    parkingFee: 0,
    roadFee: 0,
    livingFee: 0,
    waterFee: 0,
    stayFee: 0,
    otherFee: 0,
    efficiency: 0,
    totalGath: 0,
    taxiFee: 0,
    efficiency: 0,
    oilRise: 0,
    oilFee: 0,

})
const list_api = () => {
    find_data.companyNums = companyNums.value
    findStaffReimList(find_data).then(res => {
        list_data.value = res.data.list.list
        total.value = res.data.list.total


        // 累计支出
        dg.totalGath = res.data.totalGath ? parseFloat(res.data.totalGath) : 0
        dg.totalPay = res.data.totalPay ? parseFloat(res.data.totalPay) : 0
        dg.singleFee = res.data.singleFee ? parseFloat(res.data.singleFee) : 0
        dg.washingFee = res.data.washingFee ? parseFloat(res.data.washingFee) : 0
        dg.parkingFee = res.data.parkingFee ? parseFloat(res.data.parkingFee) : 0
        dg.roadFee = res.data.roadFee ? parseFloat(res.data.roadFee) : 0
        dg.livingFee = res.data.livingFee ? parseFloat(res.data.livingFee) : 0
        dg.waterFee = res.data.waterFee ? parseFloat(res.data.waterFee) : 0
        dg.stayFee = res.data.stayFee ? parseFloat(res.data.stayFee) : 0
        dg.otherFee = res.data.otherFee ? parseFloat(res.data.otherFee) : 0
        dg.totalGath = res.data.totalGath ? parseFloat(res.data.totalGath) : 0
        dg.taxiFee = res.data.taxiFee ? parseFloat(res.data.taxiFee) : 0
        dg.oilFee = res.data.oilFee ? parseFloat(res.data.oilFee) : 0
        dg.oilRise = res.data.oilRise ? parseFloat(res.data.oilRise) : 0
        dg.efficiency = res.data.efficiency ? parseFloat(res.data.efficiency) : 0



    })
}
//#endregion

//#region 添加
// 员工下拉
const serviceManList = ref([])
// 收款人
const filter_loading = ref(false)
const cusUnameOptions = ref([])
const remoteMethod = (query) => {
    if (!query) {
        filter_loading.value = false
        cusUnameOptions.value = []

        return
    }
    filter_loading.value = true
    findComboCusList({
        find: query,
        page: {
            pageNum: 1,
            pageSize: 20,
        },
    }).then(res => {
        if (res.code == 1) {
            cusUnameOptions.value = res.data
        }
        filter_loading.value = false
    })

}


// 金额类型
const reimTypeOptions = ref([])
const reimTypeOptions_com = (e) => {
    let data = ''
    for (let i = 0; i < reimTypeOptions.value.length; i++) {
        if (reimTypeOptions.value[i].id == e) {
            let obj = reimTypeOptions.value[i].other

            if (obj == 'INCOME') {
                data = '收入'
            } else if (obj == 'OUTPAY') {
                data = '支出'
            } else if (obj == 'TRANS') {
                data = '互转'
            }
        }
    }
    return data
}

const winWidth = ref('50%')
const winWidth_ok_btn = ref('40vw')
const onTabClick = (e) => {
    let name = e.index;
    console.log(name, '111')
    winWidth.value = '50%';
    winWidth_ok_btn.value = '40vw'
    // if (name == '0') {
    //     winWidth.value = '100%';
    //     winWidth_ok_btn.value = '80vw'
    // } else if (name == '1') {
    //     winWidth.value = '50%';
    //     winWidth_ok_btn.value = '40vw'
    // } else {
    //     winWidth.value = '50%';
    //     winWidth_ok_btn.value = '40vw'
    // }

}
const active = ref('2')

//#region 加油报账
let adupOilReim_submit_data = reactive({
    currentKilo: '',
    id: "",
    oilRise: "",
    oilWay: "", //eg:现金加油【XJ_JY】油票加油【YP_JY】油罐车加油【YGC_JY】油卡加油【CZK_JY】
    reimMoney: "",
    payTime: "",
    plateNum: "",
    reimVoucherUrl: "",
    remark: "",
    stationId: "",
    reimUser: "",
    reimUserId: "",

})
const oilOptions = ref([])
const adupOilReim_reimUserId_change = () => {
    for (let i = 0; i < driverList.value.length; i++) {
        if (adupOilReim_submit_data.reimUserId == driverList.value[i].ftUserId) {
            adupOilReim_submit_data.reimUser = driverList.value[i].loginPhone + '-' + driverList.value[i].realName
        }
    }
}
const adupOilReim_Ref = ref('')
const adupOilReim_ok_btn = () => {
    adupOilReim_submit_data.reimVoucherUrl = adupRewardPunish_rawFile_list.value.join(',')
    adupOilReim_Ref.value.validate((valid, fields) => {
        if (valid) {

            if (title.value == '新增驾驶员报账') {
                adupOilReim(adupOilReim_submit_data).then(res => {
                    if (res.code == 1) {
                        list_api()
                        add_off.value = false
                        return ElMessage({
                            message: res.msg,
                            type: 'success',
                        })
                    } else {
                        return ElMessage({
                            message: res.msg,
                            type: 'warning',
                        })
                    }
                })
            } else {

                adupOilReim(adupOilReim_submit_data).then(res => {
                    if (res.code == 1) {
                        list_api()
                        add_off.value = false
                        return ElMessage({
                            message: res.msg,
                            type: 'success',
                        })
                    } else {
                        return ElMessage({
                            message: res.msg,
                            type: 'warning',
                        })
                    }
                })
            }
        }
    })
}
// 图片
const rawFile_list = ref([])

const handleAvatarSuccess = (response, uploadFile) => {

    adupOilReim_submit_data.reimVoucherUrl = response.data.file.url

}
const beforeAvatarUpload = (rawFile) => {
    rawFile_list.value = []
    if (rawFile.type == 'image/jpeg' || rawFile.type == 'image/png' || rawFile.type == 'image/gif') {
        if (rawFile.size / 1024 / 1024 > 5) {
            ElMessage.error('图片大小不能大于5M!')
            return false
        }
    } else {
        ElMessage.error('请上传图片!')
        return false
    }

    rawFile_list.value.push(rawFile)
    return true

}
//#endregion

//#region 维修保养报账
const addRepairCustom_data = reactive({
    address: '',
    addressLonlat: "",
    cusCompanyName: "",
    cusPhone: "",
    cusRealName: "",
    serviceContent: "",
})
const setAddNewStationMd_off = ref(false)
const querySearchAsync = (kw, cb) => {


    if (!kw) {// 搜索关键字为空，则显示默认列表
        cb([]);
    } else {// 存在搜索关键字，则请求后台获取地图地址
        findMapPointList({
            city: '',
            isFindSta: 0,
            keywords: kw,
        }).then(res => {
            if (!res || res.code != 1) {
                cb([]);
                return ElMessage({
                    message: res.msg,
                    type: 'warning',
                })


            } else {
                let list = res.data;


                let pois = [];
                // 将请求后的数据，加入至列表
                list.forEach(it => {
                    if (it.address == '[]') it.address = '';
                    if (it.address instanceof Array) it.address = it.address.join(',');

                    pois.push({
                        id: it.id,              // id
                        lnglat: it.lnglat,      // 坐标
                        area: it.area,          // 区域
                        name: it.name,          // 名称
                        address: it.address,    // 地址
                        type: it.type,          // 地点类型
                        isSta: false            // 是否是站点
                    });
                });
                // console.log('结果数据', pois);
                cb(pois);
            }
        });
    }
}
const handleSelect = (e) => {
    if (e) {
        addRepairCustom_data.address = e.name
        addRepairCustom_data.addressLonlat = e.lnglat

    } else {
        addRepairCustom_data.address = ''
        addRepairCustom_data.addressLonlat = ''
    }

}
const setAddNewStationMd = () => {
    addRepairCustom_data.address = ''
    addRepairCustom_data.addressLonlat = ''
    addRepairCustom_data.cusCompanyName = ''
    addRepairCustom_data.cusPhone = ''
    addRepairCustom_data.cusRealName = ''
    addRepairCustom_data.serviceContent = ''
    setAddNewStationMd_off.value = true
}
const addRepairCustom_ref = ref('')
const setAddNewStationMd_ok_btn = () => {

    addRepairCustom_ref.value.validate((valid, fields) => {
        if (valid) {
            addRepairCustom(addRepairCustom_data).then(res => {
                if (res.code == 1) {
                    // list_api()
                    setAddNewStationMd_off.value = false
                    return ElMessage({
                        message: res.msg,
                        type: 'success',
                    })
                } else {
                    return ElMessage({
                        message: res.msg,
                        type: 'warning',
                    })
                }
            })
        }
    })
}
const adupRepairReim_data = reactive({
    currentKilo: '',
    payTime: "",
    payWay: "",
    plateNum: "",
    reimMoney: "",
    reimUser: "",
    reimUserId: "",
    reimVoucherUrl: "",
    remark: "",
    stationId: "",
    isMaintenance: '0',
    id: '',
})
const adupRepairReim_reimUserId_change = () => {
    for (let i = 0; i < driverList.value.length; i++) {
        if (adupRepairReim_data.reimUserId == driverList.value[i].ftUserId) {
            adupRepairReim_data.reimUser = driverList.value[i].loginPhone + '-' + driverList.value[i].realName
        }
    }
}
const repairOptions = ref([])

// 图片
// const rawFile_list2 = ref([])
// const handleAvatarSuccess2 = (response, uploadFile) => {

//     adupRepairReim_data.reimVoucherUrl = response.data.file.url

// }
// const beforeAvatarUpload2 = (rawFile) => {
//     rawFile_list2.value = []
//     if (rawFile.type == 'image/jpeg' || rawFile.type == 'image/png' || rawFile.type == 'image/gif') {
//         if (rawFile.size / 1024 / 1024 > 5) {
//             ElMessage.error('图片大小不能大于5M!')
//             return false
//         }
//     } else {
//         ElMessage.error('请上传图片!')
//         return false
//     }

//     rawFile_list2.value.push(rawFile)
//     return true

// }


const adupRepairReim_ref = ref('')
const adupRepairReim_ok_btn = () => {
    // console.log(adupRepairReim_data)
    adupRepairReim_data.reimVoucherUrl = adupRewardPunish_rawFile_list3.value.join(',')
    adupRepairReim_ref.value.validate((valid, fields) => {
        if (valid) {

            if (title.value == '新增驾驶员报账') {
                adupRepairReim_data.id = ''
                adupRepairReim(adupRepairReim_data).then(res => {
                    if (res.code == 1) {
                        list_api()
                        add_off.value = false
                        return ElMessage({
                            message: res.msg,
                            type: 'success',
                        })
                    } else {
                        return ElMessage({
                            message: res.msg,
                            type: 'warning',
                        })
                    }
                })
            } else {

                adupRepairReim(adupRepairReim_data).then(res => {
                    if (res.code == 1) {
                        list_api()
                        add_off.value = false
                        return ElMessage({
                            message: res.msg,
                            type: 'success',
                        })
                    } else {
                        return ElMessage({
                            message: res.msg,
                            type: 'warning',
                        })
                    }
                })
            }
        }
    })
}
//#endregion
//#region 审车记账
const adupCheckCarFee_data = reactive({
    currentKilo: '',
    payTime: "",
    payWay: "",
    plateNum: "",
    reimMoney: "",
    reimUser: "",
    reimUserId: "",
    reimVoucherUrl: "",
    remark: "",
    expireTime: "",
    remindDays: "",
})
const adupCheckCarFee_change = () => {
    for (let i = 0; i < driverList.value.length; i++) {
        if (adupCheckCarFee_data.reimUserId == driverList.value[i].ftUserId) {
            adupCheckCarFee_data.reimUser = driverList.value[i].loginPhone + '-' + driverList.value[i].realName
        }
    }
}
const adupCheckCarFee_ref = ref('')
const adupCheckCarFee_ok_btn = () => {
    adupCheckCarFee_data.reimVoucherUrl = adupRewardPunish_rawFile_list7.value.join(',')
    adupCheckCarFee_ref.value.validate((valid, fields) => {
        if (valid) {

            if (title.value == '新增驾驶员报账') {
                // console.log( adupNoRouteReim_data.payTime,adupNoRouteReim_timeTypeTime.value[0])
                // adupNoRouteReim_data.payTime = adupNoRouteReim_timeTypeTime.value[0]
                adupCheckCarFee(adupCheckCarFee_data).then(res => {
                    if (res.code == 1) {
                        list_api()
                        add_off.value = false
                        return ElMessage({
                            message: res.msg,
                            type: 'success',
                        })
                    } else {
                        return ElMessage({
                            message: res.msg,
                            type: 'warning',
                        })
                    }
                })
            } else {
                // adupNoRouteReim_data.payTime = adupNoRouteReim_timeTypeTime.value[0]
                adupCheckCarFee(adupCheckCarFee_data).then(res => {
                    if (res.code == 1) {
                        list_api()
                        add_off.value = false
                        return ElMessage({
                            message: res.msg,
                            type: 'success',
                        })
                    } else {
                        return ElMessage({
                            message: res.msg,
                            type: 'warning',
                        })
                    }
                })
            }
        }
    })
}
//#endregion
//#region 无业务报销
const adupNoRouteReim_data = reactive({
    costEndTime: "",
    costStartTime: "",
    currentKilo: "",
    id: "",
    moneyTypeId: "",
    payTime: "",
    payWay: "",
    plateNum: "",
    reimMoney: "",
    reimUser: "",
    reimUserId: "",
    reimVoucherUrl: "",
    remark: "",
})
const adupNoRouteReim_reimUserId_change = () => {
    for (let i = 0; i < driverList.value.length; i++) {
        if (adupNoRouteReim_data.reimUserId == driverList.value[i].ftUserId) {
            adupNoRouteReim_data.reimUser = driverList.value[i].loginPhone + '-' + driverList.value[i].realName
        }
    }
}

const adupNoRouteReim_timeTypeTime = ref('')
const adupNoRouteReim_timeTypeTime_btn = (e) => {
    if (e) {
        adupNoRouteReim_timeTypeTime.value = e
        adupNoRouteReim_data.costStartTime = adupNoRouteReim_timeTypeTime.value[0]
        adupNoRouteReim_data.payTime = adupNoRouteReim_timeTypeTime.value[0]
        adupNoRouteReim_data.costEndTime = adupNoRouteReim_timeTypeTime.value[1]
    } else {
        adupNoRouteReim_timeTypeTime.value = ''
        adupNoRouteReim_data.costStartTime = ''
        adupNoRouteReim_data.payTime = ''
        adupNoRouteReim_data.costEndTime = ''
    }
}

// 图片
// const rawFile_list3 = ref([])
// const handleAvatarSuccess3 = (response, uploadFile) => {

//     adupNoRouteReim_data.reimVoucherUrl = response.data.file.url

// }
// const beforeAvatarUpload3 = (rawFile) => {
//     rawFile_list3.value = []
//     if (rawFile.type == 'image/jpeg' || rawFile.type == 'image/png' || rawFile.type == 'image/gif') {
//         if (rawFile.size / 1024 / 1024 > 5) {
//             ElMessage.error('图片大小不能大于5M!')
//             return false
//         }
//     } else {
//         ElMessage.error('请上传图片!')
//         return false
//     }

//     rawFile_list3.value.push(rawFile)
//     return true

// }
const adupNoRouteReim_ref = ref('')
const adupNoRouteReim_data_ok_btn = () => {
    adupNoRouteReim_data.reimVoucherUrl = adupRewardPunish_rawFile_list5.value.join(',')
    adupNoRouteReim_ref.value.validate((valid, fields) => {
        if (valid) {

            if (title.value == '新增驾驶员报账') {
                // console.log( adupNoRouteReim_data.payTime,adupNoRouteReim_timeTypeTime.value[0])
                // adupNoRouteReim_data.payTime = adupNoRouteReim_timeTypeTime.value[0]
                adupNoRouteReim(adupNoRouteReim_data).then(res => {
                    if (res.code == 1) {
                        list_api()
                        add_off.value = false
                        return ElMessage({
                            message: res.msg,
                            type: 'success',
                        })
                    } else {
                        return ElMessage({
                            message: res.msg,
                            type: 'warning',
                        })
                    }
                })
            } else {
                // adupNoRouteReim_data.payTime = adupNoRouteReim_timeTypeTime.value[0]
                adupNoRouteReim(adupNoRouteReim_data).then(res => {
                    if (res.code == 1) {
                        list_api()
                        add_off.value = false
                        return ElMessage({
                            message: res.msg,
                            type: 'success',
                        })
                    } else {
                        return ElMessage({
                            message: res.msg,
                            type: 'warning',
                        })
                    }
                })
            }
        }
    })
}
//#endregion

const add_off = ref(false)
const title = ref('新增驾驶员报账')

const add_up_off = ref('1')
const add_btn = () => {
    title.value = '新增驾驶员报账'
    add_up_off.value = 1
    active.value = '2'
    adupOilReim_submit_data.currentKilo = ''
    adupOilReim_submit_data.id = ''
    adupOilReim_submit_data.oilRise = ''
    adupOilReim_submit_data.oilWay = ''
    adupOilReim_submit_data.reimMoney = ''
    adupOilReim_submit_data.payTime = ''
    adupOilReim_submit_data.plateNum = ''
    adupOilReim_submit_data.reimVoucherUrl = ''
    adupOilReim_submit_data.remark = ''
    adupOilReim_submit_data.stationId = ''
    adupOilReim_submit_data.reimUser = ''
    adupOilReim_submit_data.reimUserId = ''

    adupRepairReim_data.currentKilo = ''
    adupRepairReim_data.payTime = ''
    adupRepairReim_data.payWay = ''
    adupRepairReim_data.plateNum = ''
    adupRepairReim_data.reimMoney = ''
    adupRepairReim_data.reimUser = ''
    adupRepairReim_data.reimUserId = ''
    adupRepairReim_data.reimVoucherUrl = ''
    adupRepairReim_data.remark = ''
    adupRepairReim_data.stationId = ''
    adupRepairReim_data.isMaintenance = '0'

    adupNoRouteReim_data.costEndTime = ''
    adupNoRouteReim_data.costStartTime = ''
    adupNoRouteReim_data.currentKilo = ''
    adupNoRouteReim_data.id = ''
    adupNoRouteReim_data.moneyTypeId = ''
    adupNoRouteReim_data.payTime = ''
    adupNoRouteReim_data.payWay = ''
    adupNoRouteReim_data.plateNum = ''
    adupNoRouteReim_data.reimMoney = ''
    adupNoRouteReim_data.reimUser = ''
    adupNoRouteReim_data.reimUserId = ''
    adupNoRouteReim_data.reimVoucherUrl = ''
    adupNoRouteReim_data.remark = ''
    adupNoRouteReim_timeTypeTime.value = ''
    adupRewardPunish_rawFile_list.value = []
    adupRewardPunish_rawFile_list2.value = []
    adupRewardPunish_rawFile_list3.value = []
    adupRewardPunish_rawFile_list4.value = []
    adupRewardPunish_rawFile_list5.value = []
    adupRewardPunish_rawFile_list6.value = []
    adupRewardPunish_rawFile_list7.value = []
    adupRewardPunish_rawFile_list8.value = []

    add_off.value = true
}


//#endregion

//#region 表格选择
const table_list = ref([])
const headerdragend = (newWidth, oldWidth, column) => {
    console.log(newWidth, oldWidth, column)
    for (let i = 0; i < table_data_list_new.value.length; i++) {
        if (column.property == table_data_list_new.value[i].field) {
            table_data_list_new.value[i].width = newWidth
        }
    }
}
const selection_change_btn = (e) => {
    table_list.value = e
    console.log(e)
}
//#endregion
//#region 修改
const up_btn = () => {
    if (table_list.value.length != 1) {
        return ElMessage({
            message: '请选择一条数据！',
            type: 'warning',
        })
    }

    let no_off = 1
    let luser = JSON.parse(localStorage.getItem("luser"))
    let luser_companyNum = luser.companyNum
    let arrcompanyNum = []
    for (let i = 0; i < table_list.value.length; i++) {
        if (table_list.value[i].driverBelongCompanyInfo) {
            let data = table_list.value[i].driverBelongCompanyInfo
            let parts = data.split('-')[0]
            if (parts != luser_companyNum) {
                no_off = 0
            }
        } else {
            no_off = 1
        }

    }
    if (no_off == 0) {
        ElMessageBox.confirm(
            `此员工不是该单位的员工无法修改报账！`,
            {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                showCancelButton: false,
                type: 'warning',
                distinguishCancelAndClose: 'true',
            }
        )
            .then(() => {

            })
            .catch((e) => {


            })
    } else {
        add_up_off.value = 2
        title.value = '修改驾驶员报账'
        adupRewardPunish_rawFile_list.value = []
        adupRewardPunish_rawFile_list2.value = []
        adupRewardPunish_rawFile_list3.value = []
        adupRewardPunish_rawFile_list4.value = []
        adupRewardPunish_rawFile_list5.value = []
        adupRewardPunish_rawFile_list6.value = []
        adupRewardPunish_rawFile_list7.value = []
        adupRewardPunish_rawFile_list8.value = []

        if (table_list.value[0].moneyTypeId == '9') {
            // 维修报账
            active.value = '3'
            adupRepairReim_data.id = table_list.value[0].id
            adupRepairReim_data.currentKilo = table_list.value[0].currentKilo
            adupRepairReim_data.payTime = table_list.value[0].payTime
            adupRepairReim_data.payWay = table_list.value[0].payWay
            adupRepairReim_data.plateNum = table_list.value[0].plateNum
            adupRepairReim_data.reimMoney = table_list.value[0].reimMoney
            adupRepairReim_data.reimUser = table_list.value[0].reimUser
            adupRepairReim_data.reimUserId = table_list.value[0].reimUserId
            // adupRepairReim_data.reimVoucherUrl = table_list.value[0].reimVoucherUrl
            adupRepairReim_data.isMaintenance = table_list.value[0].isMaintenance ? String(table_list.value[0].isMaintenance) : '0'
            adupRepairReim_data.remark = table_list.value[0].remark
            adupRepairReim_data.stationId = Number(table_list.value[0].companyCustomeId)

            adupRewardPunish_rawFile_list3.value = table_list.value[0].reimVoucherUrl ? table_list.value[0].reimVoucherUrl.split(',') : ''
            if (adupRewardPunish_rawFile_list3.value.length > 0) {
                for (let i = 0; i < adupRewardPunish_rawFile_list3.value.length; i++) {
                    let data = {
                        name: i,
                        url: ImageUrl + adupRewardPunish_rawFile_list3.value[i]
                    }
                    adupRewardPunish_rawFile_list4.value.push(data)
                }
            } else {
                adupRewardPunish_rawFile_list4.value = []
            }

        } else if (table_list.value[0].moneyTypeId == '8') {
            // 燃油报账
            active.value = '2'
            adupOilReim_submit_data.currentKilo = table_list.value[0].currentKilo
            adupOilReim_submit_data.id = table_list.value[0].id
            adupOilReim_submit_data.oilRise = table_list.value[0].oilRise
            adupOilReim_submit_data.oilWay = table_list.value[0].oilWay
            adupOilReim_submit_data.reimMoney = table_list.value[0].reimMoney
            adupOilReim_submit_data.payTime = table_list.value[0].payTime
            adupOilReim_submit_data.plateNum = table_list.value[0].plateNum
            // adupOilReim_submit_data.reimVoucherUrl = table_list.value[0].reimVoucherUrl
            adupOilReim_submit_data.remark = table_list.value[0].remark
            adupOilReim_submit_data.stationId = Number(table_list.value[0].companyCustomeId)

            adupOilReim_submit_data.reimUser = table_list.value[0].reimUser
            adupOilReim_submit_data.reimUserId = table_list.value[0].reimUserId

            adupRewardPunish_rawFile_list.value = table_list.value[0].reimVoucherUrl ? table_list.value[0].reimVoucherUrl.split(',') : ''
            if (adupRewardPunish_rawFile_list.value.length > 0) {
                for (let i = 0; i < adupRewardPunish_rawFile_list.value.length; i++) {
                    let data = {
                        name: i,
                        url: ImageUrl + adupRewardPunish_rawFile_list.value[i]
                    }
                    adupRewardPunish_rawFile_list2.value.push(data)
                }
            } else {
                adupRewardPunish_rawFile_list2.value = []
            }
        } else if (table_list.value[0].moneyTypeId == '23') {
            // 审车报账
            active.value = '5'
            adupCheckCarFee_data.currentKilo = table_list.value[0].currentKilo
            adupCheckCarFee_data.id = table_list.value[0].id
            adupCheckCarFee_data.payTime = table_list.value[0].payTime
            adupCheckCarFee_data.payWay = table_list.value[0].payWay
            adupCheckCarFee_data.plateNum = table_list.value[0].plateNum
            adupCheckCarFee_data.reimMoney = table_list.value[0].reimMoney
            adupCheckCarFee_data.reimUser = table_list.value[0].reimUser
            adupCheckCarFee_data.reimUserId = table_list.value[0].reimUserId
            adupCheckCarFee_data.oilWay = table_list.value[0].oilWay
            adupCheckCarFee_data.expireTime = table_list.value[0].expireTime
            adupCheckCarFee_data.remindDays = table_list.value[0].remindDays


            adupCheckCarFee_data.remark = table_list.value[0].remark


            adupRewardPunish_rawFile_list7.value = table_list.value[0].reimVoucherUrl ? table_list.value[0].reimVoucherUrl.split(',') : ''
            if (adupRewardPunish_rawFile_list7.value.length > 0) {
                for (let i = 0; i < adupRewardPunish_rawFile_list7.value.length; i++) {
                    let data = {
                        name: i,
                        url: ImageUrl + adupRewardPunish_rawFile_list7.value[i]
                    }
                    adupRewardPunish_rawFile_list8.value.push(data)
                }
            } else {
                adupRewardPunish_rawFile_list8.value = []
            }
        } else {
            //无业务开展
            active.value = '4'
            adupNoRouteReim_data.costEndTime = table_list.value[0].costEndTime
            adupNoRouteReim_data.costStartTime = table_list.value[0].costStartTime
            adupNoRouteReim_data.currentKilo = table_list.value[0].currentKilo
            adupNoRouteReim_data.id = table_list.value[0].id
            adupNoRouteReim_data.moneyTypeId = String(table_list.value[0].moneyTypeId)

            adupNoRouteReim_data.payWay = table_list.value[0].payWay
            adupNoRouteReim_data.plateNum = table_list.value[0].plateNum
            adupNoRouteReim_data.reimMoney = table_list.value[0].reimMoney
            adupNoRouteReim_data.reimUser = table_list.value[0].reimUser
            adupNoRouteReim_data.reimUserId = table_list.value[0].reimUserId
            // adupNoRouteReim_data.reimVoucherUrl = table_list.value[0].reimVoucherUrl
            adupNoRouteReim_data.remark = table_list.value[0].remark
            adupNoRouteReim_data.payTime = table_list.value[0].payTime
            adupNoRouteReim_timeTypeTime.value = [table_list.value[0].costStartTime, table_list.value[0].costEndTime]

            adupRewardPunish_rawFile_list5.value = table_list.value[0].reimVoucherUrl ? table_list.value[0].reimVoucherUrl.split(',') : ''
            if (adupRewardPunish_rawFile_list5.value.length > 0) {
                for (let i = 0; i < adupRewardPunish_rawFile_list5.value.length; i++) {
                    let data = {
                        name: i,
                        url: ImageUrl + adupRewardPunish_rawFile_list5.value[i]
                    }
                    adupRewardPunish_rawFile_list6.value.push(data)
                }
            } else {
                adupRewardPunish_rawFile_list6.value = []
            }
        }
        // add_data.tableData[0].operUseId = table_list.value[0].operUserId
        // add_data.tableData[0].reimUser = table_list.value[0].reimUser
        // add_data.tableData[0].reimUserId = table_list.value[0].reimUserId
        // add_data.tableData[0].plateNum = table_list.value[0].plateNum
        // add_data.tableData[0].reimMoney = table_list.value[0].reimMoney
        // add_data.tableData[0].remark = table_list.value[0].remark
        // add_data.tableData[0].reimVoucherUrl = table_list.value[0].reimVoucherUrl
        // add_data.tableData[0].moneyTypeId = table_list.value[0].moneyTypeId
        add_off.value = true
    }





}
//#endregion

// 提交
const formRef = ref('')
const ok_btn = () => {

    formRef.value.validate((valid, fields) => {
        if (valid) {
            if (title.value == '新增驾驶员报账') {
                let list = add_data.tableData;


                let ps = {
                    staffReimInfo: list
                }

                addStaffReimburse(ps).then(res => {
                    if (res.code == 1) {
                        list_api()
                        add_off.value = false
                        return ElMessage({
                            message: res.msg,
                            type: 'success',
                        })
                    } else {
                        return ElMessage({
                            message: res.msg,
                            type: 'warning',
                        })
                    }
                })
            } else {
                let ps = {
                    id: table_list.value[0].id,
                    moneyTypeId: add_data.tableData[0].moneyTypeId,
                    operUserId: add_data.tableData[0].operUseId,
                    plateNum: add_data.tableData[0].plateNum,
                    reimMoney: add_data.tableData[0].reimMoney,
                    reimUser: add_data.tableData[0].reimUser,
                    reimUserId: add_data.tableData[0].reimUserId,
                    reimVoucherUrl: add_data.tableData[0].reimVoucherUrl,
                    remark: add_data.tableData[0].remark,
                }
                modifyStaffReimburse(ps).then(res => {
                    if (res.code == 1) {
                        list_api()
                        add_off.value = false
                        return ElMessage({
                            message: res.msg,
                            type: 'success',
                        })
                    } else {
                        return ElMessage({
                            message: res.msg,
                            type: 'warning',
                        })
                    }
                })
            }
        }
    })


}


//#region 删除
const del_btn = () => {
    if (table_list.value.length != 1) {
        return ElMessage({
            message: '请选择一条数据！',
            type: 'warning',
        })
    }
    let no_off = 1
    let luser = JSON.parse(localStorage.getItem("luser"))
    let luser_companyNum = luser.companyNum
    for (let i = 0; i < table_list.value.length; i++) {
        if (table_list.value[i].driverBelongCompanyInfo) {
            let data = table_list.value[i].driverBelongCompanyInfo
            let parts = data.split('-')[0]
            if (parts != luser_companyNum) {
                no_off = 0
            }
        } else {
            no_off = 1
        }

    }
    if (no_off == 0) {
        ElMessageBox.confirm(
            `此员工不是该单位的员工无法删除报账！`,
            {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                showCancelButton: false,
                type: 'warning',
                distinguishCancelAndClose: 'true',
            }
        )
            .then(() => {

            })
            .catch((e) => {


            })
    } else {
        ElMessageBox.confirm(
            `是否确认删除【${table_list.value[0].operName}】报账?`,
            {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning',
                distinguishCancelAndClose: 'true',
            }
        )
            .then(() => {
                delStaffReim({
                    ids: [table_list.value[0].id]
                }).then(res => {
                    if (res.code == 1) {
                        list_api()
                        return ElMessage({
                            message: res.msg,
                            type: 'success',
                        })
                    } else {
                        return ElMessage({
                            message: res.msg,
                            type: 'warning',
                        })
                    }
                })
            })
            .catch((e) => {
                if (e == 'cancel') {
                    ElMessage({
                        type: 'warning',
                        message: '取消删除成功',
                    })
                }

            })
    }




}
//#endregion

//#region 搜索
const search_btn = () => {
    // localStorage.setItem('employee_reimbursement2', CircularJSON.stringify(find_data))
    console.log(find_data)
    list_api()
}
//#endregion

//#region 审核
const checkBzRecord = (e) => {
    let rows = table_list.value
    if (table_list.value.length < 1) {
        return ElMessage({
            message: '请选择一条数据！',
            type: 'warning',
        })
    }
    let no_off = 1
    let luser = JSON.parse(localStorage.getItem("luser"))
    let luser_companyNum = luser.companyNum
    let arrcompanyNum = []
    for (let i = 0; i < table_list.value.length; i++) {
        if (table_list.value[i].driverBelongCompanyInfo) {
            let data = table_list.value[i].driverBelongCompanyInfo
            let parts = data.split('-')[0]
            if (parts != luser_companyNum) {
                no_off = 0
            }
        } else {
            no_off = 1
        }

    }
    if (no_off == 0) {
        ElMessageBox.confirm(
            `此员工不是该单位的员工无法审核报账！`,
            {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                showCancelButton: false,
                type: 'warning',
                distinguishCancelAndClose: 'true',
            }
        )
            .then(() => {

            })
            .catch((e) => {


            })
    } else {
        let fg = true;
        if (fg) {
            let isObj = rows.find(it => it.isCheck != 'NO_CHECK');
            if (isObj) {
                fg = false
                return ElMessage({
                    message: `所选报账存在【已审核】记录，不能操作`,
                    type: 'warning',
                })
            }
        }



        if (e == 'CHECKED') {
            ElMessageBox.confirm(
                '是否将选中报账<b style="color:red;font-weight:700">通过审核</b>？',
                {
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    type: 'warning',
                    distinguishCancelAndClose: 'true',
                    dangerouslyUseHTMLString: true,
                }
            )
                .then(() => {



                    let idArr = rows.map(item => item.id);
                    checkStaffReimburse({
                        ids: idArr,
                        isCheck: 'CHECKED',
                        remark: '通过'
                    }).then(res => {
                        if (res.code == 1) {
                            list_api()
                            return ElMessage({
                                message: res.msg,
                                type: 'success',
                            })
                        } else {
                            return ElMessage({
                                message: res.msg,
                                type: 'warning',
                            })
                        }
                    })
                })
                .catch((e) => {
                    if (e == 'cancel') {
                        ElMessage({
                            type: 'warning',
                            message: '取消成功',
                        })
                    }

                })
        } else if (e == 'REFUSED') {
            ElMessageBox.prompt(
                '请输入审核<b style="color:red;font-weight:700">不通过原由</b>？',
                {
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    type: 'warning',
                    distinguishCancelAndClose: 'true',
                    dangerouslyUseHTMLString: true,
                }
            )
                .then(({ value }) => {



                    let idArr = rows.map(item => item.id);
                    checkStaffReimburse({
                        ids: idArr,
                        isCheck: 'REFUSED',
                        remark: value,
                    }).then(res => {
                        if (res.code == 1) {
                            list_api()
                            return ElMessage({
                                message: res.msg,
                                type: 'success',
                            })
                        } else {
                            return ElMessage({
                                message: res.msg,
                                type: 'warning',
                            })
                        }
                    })
                })
                .catch((e) => {
                    if (e == 'cancel') {
                        ElMessage({
                            type: 'warning',
                            message: '取消成功',
                        })
                    }

                })
        }
    }






}
//#endregion

//#region 驳回
const setTurnDownStaffReimMd_data = reactive({
    ids: '',
    refuseReason: '',
})
const setTurnDownStaffReimMd_ref = ref('')
const setTurnDownStaffReimMd_off = ref(false)
const setTurnDownStaffReimMd = () => {
    let rows = table_list.value
    if (table_list.value.length < 1) {
        return ElMessage({
            message: '请选择一条数据！',
            type: 'warning',
        })
    }

    let no_off = 1
    let luser = JSON.parse(localStorage.getItem("luser"))
    let luser_companyNum = luser.companyNum
    let arrcompanyNum = []
    for (let i = 0; i < table_list.value.length; i++) {
        if (table_list.value[i].driverBelongCompanyInfo) {
            let data = table_list.value[i].driverBelongCompanyInfo
            let parts = data.split('-')[0]
            if (parts != luser_companyNum) {
                no_off = 0
            }
        } else {
            no_off = 1
        }

    }
    if (no_off == 0) {
        ElMessageBox.confirm(
            `此员工不是该单位的员工无法驳回报账！`,
            {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                showCancelButton: false,
                type: 'warning',
                distinguishCancelAndClose: 'true',
            }
        )
            .then(() => {

            })
            .catch((e) => {


            })
    } else {
        let isCheck = rows.every(it => it.isCheck === 'CHECKED');
        if (!isCheck) {
            return ElMessage({
                message: "只有【已审核】的才能进行驳回操作",
                type: 'warning',
            })
        }
        setTurnDownStaffReimMd_data.ids = ''
        setTurnDownStaffReimMd_data.refuseReason = ''
        setTurnDownStaffReimMd_off.value = true
    }
}
const setTurnDownStaffReimMd_ok_btn1 = () => {
    console.log(setTurnDownStaffReimMd_data.refuseReason)
    let rows = table_list.value
    let idArr = rows.map(item => item.id);
    setTurnDownStaffReimMd_ref.value.validate((valid, fields) => {
        if (valid) {
            let ps = {
                ids: idArr,
                refuseReason: setTurnDownStaffReimMd_data.refuseReason
            }
            checkRefuse(ps).then(res => {
                if (res.code == 1) {
                    list_api()
                    setTurnDownStaffReimMd_off.value = false
                    return ElMessage({
                        message: res.msg,
                        type: 'success',
                    })
                } else {
                    return ElMessage({
                        message: res.msg,
                        type: 'warning',
                    })
                }
            })
        }
    })
}





//#endregion

//#region 核销
const Write_off = ref(false)
const Write_data = reactive({
    btlIds: '',
    enterTime: "",
    ids: "",
}) // 入账月份
const Write_data__find_list = reactive({
    page: {
        pageNum: 1,
        pageSize: 20,
    },//
    timeType: '0', //
    stime: '', //
    etime: '', //
    isCheck: 'NO_CHECK',
    moneyTypeIds: '', //
    remark: '', //
    tradeMoney: '', //
    tradeStatus: '1', //
    transName: '', //
})
const Write_timeTypeTime = ref('')
const Write_timeTypeTime_btn = (e) => {
    if (e) {
        Write_timeTypeTime.value = e
        Write_data__find_list.stime = Write_timeTypeTime.value[0]
        Write_data__find_list.etime = Write_timeTypeTime.value[1]
    } else {
        Write_timeTypeTime.value = ''
        Write_data__find_list.stime = ''
        Write_data__find_list.etime = ''
    }
}
const Write_find_btn = () => {
    Write_list_api()
}
const Write_data__list = ref([])
const Write_data__find_list_total = ref(0)
const Write_list_api = () => {
    Write_data__find_list.moneyTypeIds ? Write_data__find_list.moneyTypeIds = [Write_data__find_list.moneyTypeIds] : Write_data__find_list.moneyTypeIds = []
    findBankTradeList(Write_data__find_list).then(res => {
        Write_data__list.value = res.data.list.list
        Write_data__find_list_total.value = res.data.list.total
        Write_data__find_list.moneyTypeIds[0] ? Write_data__find_list.moneyTypeIds = Write_data__find_list.moneyTypeIds[0] : Write_data__find_list.moneyTypeIds = ''
    })
}
// 分页器一夜显示多少数据页面
const Write_size_change_btn = () => {
    Write_data__find_list.page.pageNum = 1
    Write_list_api()
}

// 分页器跳转页面
const Write_current_change_btn = () => {
    Write_list_api()
}

//#region 表格选择
const table_list2 = ref([])
const selection_change_btn2 = (e) => {
    table_list2.value = e
    console.log(e, 'table_list2')
}
//#endregion
const Write_totalshou = ref(0) //累计收
const Write_totalPay = ref(0) //累计支出
const Write_totalcha = ref(0) //累计差
const Write_seledPay = computed(() => {
    let money = 0
    let rows = table_list2.value
    rows.forEach(it => {
        money += parseFloat(it.tradeOutMoney ? it.tradeOutMoney : 0);
    });

    return (money).toFixed(2);

})

const Write_seledGath = computed(() => {
    let money = 0
    let rows = table_list2.value
    rows.forEach(it => {
        money += parseFloat(it.tradeInMoney ? it.tradeInMoney : 0);
    });

    return (money).toFixed(2);

})

const Write_seledBalance = computed(() => {
    let money = 0
    let rows = table_list2.value
    rows.forEach(it => {
        money += Math.abs(parseFloat(it.tradeInMoney ? it.tradeInMoney : 0) - parseFloat(it.tradeOutMoney ? it.tradeOutMoney : 0));
    });
    return (money).toFixed(2);

})
const Write_off_btn = () => {
    let rows = table_list.value
    if (table_list.value.length < 1) {
        return ElMessage({
            message: '请选择一条数据！',
            type: 'warning',
        })
    } else {
        let no_off = 1
        let luser = JSON.parse(localStorage.getItem("luser"))
        let luser_companyNum = luser.companyNum
        let arrcompanyNum = []
        for (let i = 0; i < table_list.value.length; i++) {
            if (table_list.value[i].driverBelongCompanyInfo) {
                let data = table_list.value[i].driverBelongCompanyInfo
                let parts = data.split('-')[0]
                if (parts != luser_companyNum) {
                    no_off = 0
                }
            } else {
                no_off = 1
            }

        }
        if (no_off == 0) {
            ElMessageBox.confirm(
                `此员工不是该单位的员工无法修改报账！`,
                {
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    showCancelButton: false,
                    type: 'warning',
                    distinguishCancelAndClose: 'true',
                }
            )
                .then(() => {

                })
                .catch((e) => {


                })
        } else {
            let isObj = rows.find(it => it.isCheck !== 'CHECKED');
            if (isObj) {
                return ElMessage({
                    message: `所选数据存在不是【已审核】，不能核销`,
                    type: 'warning',
                })
            } else {
                let retArr = rows.map(item => item.reimUserId);
                // 是否存在不同收款人
                let isEqualUser = [...new Set(retArr)];
                if (isEqualUser && isEqualUser.length > 1) {
                    return ElMessage({
                        message: "核销收款人必须是【同一用户】",
                        type: 'warning',
                    })
                } else {
                    let totalGath = 0, totalPay = 0, totalBalance = 0;
                    rows.forEach(it => {
                        // // 累计收入
                        totalGath += parseFloat(it.gathMoney);
                        // 累计支出
                        totalPay += parseFloat(it.reimMoney);
                        // // 收支差额
                        totalBalance += Math.abs(parseFloat(it.gathMoney) - parseFloat(it.reimMoney));
                        Write_totalshou.value = (totalGath).toFixed(2);
                        Write_totalPay.value = (totalPay).toFixed(2);
                        Write_totalcha.value = (totalBalance).toFixed(2);
                    });
                    Write_list_api()
                    Write_data.enterTime = ''

                    if (table_list.value[0].gathMoney > 0) {
                        Write_data__find_list.tradeStatus = '0'
                    } else {
                        Write_data__find_list.tradeStatus = '1'
                    }


                    Write_off.value = true
                }
            }
        }





    }




}
const Write_ok_btn = () => {

    let rows = table_list2.value

    if (rows.length === 0) {
        return ElMessage({
            message: "请选择要核销的记录",
            type: 'warning',
        })

    } else {
        if (!Write_data.enterTime) {

            return ElMessage({
                message: '请选择入账月份',
                type: 'warning',
            })
        } else if (!table_list.value[0] || table_list.value.length == 0) {
            return ElMessage({
                message: '您未选择报账记录，请关闭弹框重新选择报账记录',
                type: 'warning',
            })

        } else if (table_list.value.length > 1 && rows.length > 1) {
            return ElMessage({
                message: '您有多条报账记录，只能选择1条核销记录',
                type: 'warning',
            })

        } else {
            let ps = {
                btlIds: rows.map(it => it.id),
                enterTime: Write_data.enterTime + ' ' + '00:00:00',
                ids: table_list.value.map(it => it.id),
            }
            cancellationStaffReim(ps).then(res => {
                if (res.code == 1) {
                    list_api()
                    Write_list_api()
                    Write_off.value = false
                    return ElMessage({
                        message: res.msg,
                        type: 'success',
                    })
                } else {
                    return ElMessage({
                        message: res.msg,
                        type: 'warning',
                    })
                }
            })
        }
    }
    console.log(Write_data)
}
//#endregion

//#region 撤销核销
const cancelWriteOff = () => {
    let rows = table_list.value

    if (table_list.value.length != 1) {
        return ElMessage({
            message: '请至少选择一条要撤销的数据',
            type: 'warning',
        })
    } else {
        let no_off = 1
        let luser = JSON.parse(localStorage.getItem("luser"))
        let luser_companyNum = luser.companyNum
        let arrcompanyNum = []
        for (let i = 0; i < table_list.value.length; i++) {
            if (table_list.value[i].driverBelongCompanyInfo) {
                let data = table_list.value[i].driverBelongCompanyInfo
                let parts = data.split('-')[0]
                if (parts != luser_companyNum) {
                    no_off = 0
                }
            } else {
                no_off = 1
            }

        }
        if (no_off == 0) {
            ElMessageBox.confirm(
                `此员工不是该单位的员工无法修改报账！`,
                {
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    showCancelButton: false,
                    type: 'warning',
                    distinguishCancelAndClose: 'true',
                }
            )
                .then(() => {

                })
                .catch((e) => {


                })
        } else {
            let isObj = rows.find(it => it.isCheck != 'CANCELLATION');
            if (isObj) {
                return ElMessage({
                    message: '所选数据不是【已报销】，不能撤销',
                    type: 'warning',
                })

            } else {
                ElMessageBox.confirm(
                    `确定撤销【已报销】的报账记录？`,
                    {
                        confirmButtonText: '确认',
                        cancelButtonText: '取消',
                        type: 'warning',
                        distinguishCancelAndClose: 'true',
                    }
                )
                    .then(() => {
                        cancelStaffReim({
                            ids: [table_list.value[0].id]
                        }).then(res => {
                            if (res.code == 1) {
                                list_api()
                                return ElMessage({
                                    message: res.msg,
                                    type: 'success',
                                })
                            } else {
                                return ElMessage({
                                    message: res.msg,
                                    type: 'warning',
                                })
                            }
                        })
                    })
                    .catch((e) => {
                        if (e == 'cancel') {
                            ElMessage({
                                type: 'warning',
                                message: '取消删除成功',
                            })
                        }

                    })



            }
        }





    }
}
//#endregion

//#region 交易记录列表导出
const ex_getWalletListForBack_btn = () => {
    staffReimExport(find_data).then(res => {
        if (res.code == 1) {
            const data = [
                ['经办人信息', '收款人信息', '车牌号', '车辆公里数', '业务部门', '报账详情', '支出金额', '支出金额详情', '记账审核状态', '驳回原因', '报账类型', '支付日期', '费用产生日期', '费用结束日期', '入账月份', '下次到期时间', '提前提醒天数', '添加时间', '操作标识', '操作备注'],
            ];
            for (let i = 0; i < res.data.length; i++) {
                let ps = {

                    operUser: res.data[i].operUser,
                    reimUser: res.data[i].reimUser,
                    plateNum: res.data[i].plateNum,
                    currentKilo: res.data[i].currentKilo,
                    deptName: res.data[i].deptName,
                    remark: res.data[i].remark,
                    reimMoney: res.data[i].reimMoney,
                    reimMoneyDetail: res.data[i].reimMoneyDetail,
                    isCheck: res.data[i].isCheck == 'NO_CHECK' ? '未操作' : res.data[i].isCheck == 'CANCELLATION' ? '已报销' : res.data[i].isCheck
                        ==
                        'SETTLED' ? '已结算' : '无',
                    refuseReason: res.data[i].refuseReason,
                    moneyTypeName: res.data[i].moneyTypeName,
                    payTime: timeset(res.data[i].payTime),
                    costStartTime: timeset(res.data[i].costStartTime),
                    costEndTime: timeset(res.data[i].costEndTime),
                    enterTime: timeset(res.data[i].enterTime),
                    expireTime: timeset(res.data[i].expireTime),
                    remindDays: res.data[i].remindDays,
                    addTime: timeset(res.data[i].addTime),
                    operMark: res.data[i].operMark,
                    operNote: res.data[i].operNote,

                }
                console.log(ps)
                data.push(Object.values(ps))
            }

            const ws = XLSX.utils.aoa_to_sheet(data);
            const wb = XLSX.utils.book_new();
            XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
            XLSX.writeFile(wb, '单位管理后台系统-驾驶员报账列表.xlsx');
            list_api()
            return ElMessage({
                message: res.msg,
                type: 'success',
            })
        } else {
            return ElMessage({
                message: res.msg,
                type: 'warning',
            })
        }

    })
}

const timeset = (e) => {

    // 将原始日期时间转换为 Date 对象
    let dateTime = new Date(e);

    // 格式化日期时间为 YYYY-MM-DD HH:mm:ss
    let formattedDateTime = dateTime.toISOString().slice(0, 19).replace("T", " ");
    return formattedDateTime
}
//#endregion

</script>

<style scoped lang='scss'>
.route-tips {
    max-width: 500px !important;
}

.filter-container {
    line-height: 30px;
    position: relative;
}

.dgts-row {
    display: flex;
    line-height: 20px;
    margin-top: 5px;
    margin-bottom: 5px;
    margin-right: 30px !important;

    /* 列表顶部工具栏统计等文本--begin */
    .dgts-text {
        // 当文本和按钮等放一行时需要加此类样式
        line-height: 30px;
    }

    .tr-it-title {
        font-size: 15px;
    }

    .tr-it {
        font-size: 13px;
    }

    .dgts-text-tj1 {
        line-height: 30px;
        margin: 0px 10px;
        background: #fde2e2;
        border-radius: 5px;
        padding: 0px 10px;
    }

    .dgts-text-tj2 {
        line-height: 30px;
        margin: 0px 10px;
        background: #b3d8ff;
        border-radius: 5px;
        padding: 0px 10px;
    }


}

.c-green {
    color: #008000;
}

.c-yellow {
    color: #FF872A;
}

.c-red {
    color: #FF0000;
}
</style>

<style>
.avatar-uploader .avatar {
    width: 100px;
    height: 50px;
    display: block;
}


.avatar-uploader .el-upload {
    border: 1px dashed var(--el-border-color);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--el-transition-duration-fast);
}

.avatar-uploader .el-upload:hover {
    border-color: var(--el-color-primary);
}

.el-icon.avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 100px;
    height: 50px;
    text-align: center;
}

.col-items::-webkit-scrollbar {
    width: 5px !important;
}

.col-items>label {
    margin-left: 0px !important;
    margin-top: 5px;
    width: 100%;
}

.card_css>.el-card__header {
    padding: 5px !important;
}

.el-table .el-table__cell {
    padding: 0px !important;
}

/* table顶部顶部工具栏 */
.filter-container .dgts-row .el-form-item,
.filter-container .el-form .el-form-item {
    margin-bottom: 0px !important;
}

.filter-container .el-form--inline .el-form-item {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 9px;
}

.my-autocomplete {
    width: auto !important;

    li {
        position: relative;
        line-height: 20px !important;
        margin-bottom: 10px !important;
    }
}

.my-autocomplete {
    li {
        .name {
            max-width: 20em;
            text-overflow: ellipsis;
            overflow: hidden;
            text-align: left;
        }

        .addr {
            display: block;
            max-width: 24em;
            text-overflow: ellipsis;
            overflow: hidden;
            font-size: 12px;
            color: #b4b4b4;
            text-align: left;
        }

        .highlighted .addr {
            color: #ddd;
        }

        .sta-icon {
            position: absolute;
            bottom: 0px;
            left: 2px;
            color: #ff6300;
            font-size: 16px;
            display: inline-block;
            height: 100%;
            line-height: 40px;
            font-style: normal;
        }
    }
}
</style>
